@@ -95,9 +95,7 @@ func (p *Parser) parseSingleStringTable(name string) {
9595}
9696
9797func (p * Parser ) handleUpdateStringTable (tab * msg.CSVCMsg_UpdateStringTable ) {
98- defer func () {
99- p .setError (recoverFromUnexpectedEOF (recover ()))
100- }()
98+ // No need for recoverFromUnexpectedEOF here as we do that in processStringTable already
10199
102100 cTab := p .stringTables [tab .TableId ]
103101 switch cTab .Name {
@@ -107,11 +105,22 @@ func (p *Parser) handleUpdateStringTable(tab *msg.CSVCMsg_UpdateStringTable) {
107105 fallthrough
108106 case stNameInstanceBaseline :
109107 // Only handle updates for the above types
110- p .handleCreateStringTable (cTab )
108+ // Create fake CreateStringTable and handle it like one of those
109+ cTab .NumEntries = tab .NumChangedEntries
110+ cTab .StringData = tab .StringData
111+ p .processStringTable (cTab )
111112 }
112113}
113114
114115func (p * Parser ) handleCreateStringTable (tab * msg.CSVCMsg_CreateStringTable ) {
116+ // No need for recoverFromUnexpectedEOF here as we do that in processStringTable already
117+
118+ p .processStringTable (tab )
119+
120+ p .stringTables = append (p .stringTables , tab )
121+ }
122+
123+ func (p * Parser ) processStringTable (tab * msg.CSVCMsg_CreateStringTable ) {
115124 defer func () {
116125 p .setError (recoverFromUnexpectedEOF (recover ()))
117126 }()
@@ -189,19 +198,17 @@ func (p *Parser) handleCreateStringTable(tab *msg.CSVCMsg_CreateStringTable) {
189198 p .rawPlayers [entryIndex ] = parsePlayerInfo (bytes .NewReader (userdat ))
190199
191200 case stNameInstanceBaseline :
192- classid , err := strconv .ParseInt (entry , 10 , 64 )
201+ classID , err := strconv .ParseInt (entry , 10 , 64 )
193202 if err != nil {
194203 panic ("WTF VOLVO PLS" )
195204 }
196- p .instanceBaselines [int (classid )] = userdat
205+ p .instanceBaselines [int (classID )] = userdat
197206
198207 case stNameModelPreCache :
199208 p .modelPreCache [entryIndex ] = entry
200209 }
201210 }
202211 br .Pool ()
203-
204- p .stringTables = append (p .stringTables , tab )
205212}
206213
207214func parsePlayerInfo (reader io.Reader ) * playerInfo {
0 commit comments