@@ -22,7 +22,6 @@ func (p *parser) handleGameEventList(gel *msg.CSVCMsg_GameEventList) {
22
22
func (p * parser ) handleGameEvent (ge * msg.CSVCMsg_GameEvent ) {
23
23
if p .gameEventDescs == nil {
24
24
p .eventDispatcher .Dispatch (events.ParserWarn {Message : "received GameEvent but event descriptors are missing" })
25
- unassert .Error ("received GameEvent but event descriptors are missing" )
26
25
27
26
return
28
27
}
@@ -107,6 +106,7 @@ func newGameEventHandler(parser *parser) gameEventHandler {
107
106
108
107
geh .gameEventNameToHandler = map [string ]gameEventHandlerFunc {
109
108
// sorted alphabetically
109
+ "ammo_pickup" : nil , // Dunno, only in locally recorded (POV) demo
110
110
"announce_phase_end" : nil , // Dunno
111
111
"begin_new_match" : geh .beginNewMatch , // Match started
112
112
"bomb_beep" : nil , // Bomb beep
@@ -119,6 +119,7 @@ func newGameEventHandler(parser *parser) gameEventHandler {
119
119
"bomb_planted" : delayIfNoPlayers (geh .bombPlanted ), // Plant finished
120
120
"bot_takeover" : delay (geh .botTakeover ), // Bot got taken over
121
121
"buytime_ended" : nil , // Not actually end of buy time, seems to only be sent once per game at the start
122
+ "cs_intermission" : nil , // Dunno, only in locally recorded (POV) demo
122
123
"cs_match_end_restart" : nil , // Yawn
123
124
"cs_pre_restart" : nil , // Not sure, doesn't seem to be important
124
125
"cs_round_final_beep" : nil , // Final beep
@@ -128,24 +129,26 @@ func newGameEventHandler(parser *parser) gameEventHandler {
128
129
"decoy_detonate" : geh .decoyDetonate , // Decoy exploded/expired
129
130
"decoy_started" : delay (geh .decoyStarted ), // Decoy started. Delayed because projectile entity is not yet created
130
131
"endmatch_cmm_start_reveal_items" : nil , // Drops
131
- "entity_visible" : nil , // Dunno, only in locally recorded demo
132
- "enter_bombzone" : nil , // Dunno, only in locally recorded demo
133
- "exit_bombzone" : nil , // Dunno, only in locally recorded demo
134
- "enter_buyzone" : nil , // Dunno, only in locally recorded demo
135
- "exit_buyzone" : nil , // Dunno, only in locally recorded demo
132
+ "entity_visible" : nil , // Dunno, only in locally recorded (POV) demo
133
+ "enter_bombzone" : nil , // Dunno, only in locally recorded (POV) demo
134
+ "exit_bombzone" : nil , // Dunno, only in locally recorded (POV) demo
135
+ "enter_buyzone" : nil , // Dunno, only in locally recorded (POV) demo
136
+ "exit_buyzone" : nil , // Dunno, only in locally recorded (POV) demo
136
137
"flashbang_detonate" : geh .flashBangDetonate , // Flash exploded
137
138
"hegrenade_detonate" : geh .heGrenadeDetonate , // HE exploded
138
139
"hltv_chase" : nil , // Don't care
139
140
"hltv_fixed" : nil , // Dunno
140
141
"hltv_message" : nil , // No clue
141
142
"hltv_status" : nil , // Don't know
143
+ "hostname_changed" : nil , // Only present in locally recorded (POV) demos
142
144
"inferno_expire" : geh .infernoExpire , // Incendiary expired
143
145
"inferno_startburn" : delay (geh .infernoStartBurn ), // Incendiary exploded/started. Delayed because inferno entity is not yet created
144
- "inspect_weapon" : nil , // Dunno, only in locally recorded demo
146
+ "inspect_weapon" : nil , // Dunno, only in locally recorded (POV) demos
145
147
"item_equip" : delay (geh .itemEquip ), // Equipped / weapon swap, I think. Delayed because of #142 - Bot entity possibly not yet created
146
148
"item_pickup" : delay (geh .itemPickup ), // Picked up or bought? Delayed because of #119 - Equipment.UniqueID()
149
+ "item_pickup_slerp" : nil , // Not sure, only in locally recorded (POV) demos
147
150
"item_remove" : geh .itemRemove , // Dropped?
148
- "jointeam_failed" : nil , // Dunno, only in locally recorded demo
151
+ "jointeam_failed" : nil , // Dunno, only in locally recorded (POV) demos
149
152
"other_death" : nil , // Dunno
150
153
"player_blind" : delay (geh .playerBlind ), // Player got blinded by a flash. Delayed because Player.FlashDuration hasn't been updated yet
151
154
"player_changename" : nil , // Name change
@@ -158,7 +161,8 @@ func newGameEventHandler(parser *parser) gameEventHandler {
158
161
"player_hurt" : geh .playerHurt , // Player got hurt
159
162
"player_jump" : geh .playerJump , // Player jumped
160
163
"player_spawn" : nil , // Player spawn
161
- "player_given_c4" : nil , // Dunno, only present in POV demos
164
+ "player_spawned" : nil , // Only present in locally recorded (POV) demos
165
+ "player_given_c4" : nil , // Dunno, only present in locally recorded (POV) demos
162
166
163
167
// Player changed team. Delayed for two reasons
164
168
// - team IDs of other players changing teams in the same tick might not have changed yet
@@ -187,7 +191,7 @@ func newGameEventHandler(parser *parser) gameEventHandler {
187
191
"weapon_fire_on_empty" : nil , // Sounds boring
188
192
"weapon_reload" : geh .weaponReload , // Weapon reloaded
189
193
"weapon_zoom" : nil , // Zooming in
190
- "weapon_zoom_rifle" : nil , // Dunno, only in locally recorded demo
194
+ "weapon_zoom_rifle" : nil , // Dunno, only in locally recorded (POV) demo
191
195
}
192
196
193
197
return geh
@@ -523,7 +527,11 @@ func (geh gameEventHandler) bombPlanted(data map[string]*msg.CSVCMsg_GameEventKe
523
527
}
524
528
525
529
event := events.BombPlanted {BombEvent : bombEvent }
526
- event .Player .IsPlanting = false
530
+
531
+ if event .Player != nil { // if not nil check is necessary for POV demos
532
+ event .Player .IsPlanting = false
533
+ }
534
+
527
535
geh .parser .gameState .currentPlanter = nil
528
536
geh .dispatch (event )
529
537
}
@@ -681,10 +689,6 @@ func (geh gameEventHandler) getThrownGrenade(p *common.Player, wepType common.Eq
681
689
}
682
690
}
683
691
684
- // smokes might have duplicate smokegrenade_expired events, so it could have already been deleted.
685
- // if it's not a smoke this should never be reached
686
- unassert .Samef (wepType , common .EqSmoke , "tried to get non-existing grenade from gameState.thrownGrenades" )
687
-
688
692
return nil
689
693
}
690
694
@@ -705,10 +709,6 @@ func (geh gameEventHandler) deleteThrownGrenade(p *common.Player, wepType common
705
709
return
706
710
}
707
711
}
708
-
709
- // smokes might have duplicate smokegrenade_expired events, so it might already be deleted.
710
- // besides that this code should never be reached
711
- unassert .Samef (wepType , common .EqSmoke , "trying to delete non-existing grenade from gameState.thrownGrenades" )
712
712
}
713
713
714
714
func (geh gameEventHandler ) attackerWeaponType (wepType common.EquipmentType , victimUserID int32 ) common.EquipmentType {
0 commit comments