@@ -210,7 +210,7 @@ func newGameEventHandler(parser *parser, ignoreBombsiteIndexNotFound bool) gameE
210210 "item_pickup_slerp" : nil , // Not sure, only in locally recorded (POV) demos
211211 "item_remove" : geh .itemRemove , // Dropped?
212212 "jointeam_failed" : nil , // Dunno, only in locally recorded (POV) demos
213- "other_death" : nil , // Dunno
213+ "other_death" : geh . otherDeath , // Other deaths, like chickens.
214214 "player_blind" : delay (geh .playerBlind ), // Player got blinded by a flash. Delayed because Player.FlashDuration hasn't been updated yet
215215 "player_changename" : nil , // Name change
216216 "player_connect" : geh .playerConnect , // Bot connected or player reconnected, players normally come in via string tables & data tables
@@ -839,6 +839,28 @@ func (geh gameEventHandler) itemRemove(data map[string]*msg.CSVCMsg_GameEventKey
839839 })
840840}
841841
842+ func (geh gameEventHandler ) otherDeath (data map [string ]* msg.CSVCMsg_GameEventKeyT ) {
843+ killer := geh .playerByUserID32 (data ["attacker" ].GetValShort ())
844+ otherType := data ["othertype" ].GetValString ()
845+ otherID := data ["otherid" ].GetValShort ()
846+ otherPosition := geh .gameState ().entities [int (otherID )].Position ()
847+ wepType := common .MapEquipment (data ["weapon" ].GetValString ())
848+ weapon := getPlayerWeapon (killer , wepType )
849+
850+ geh .dispatch (events.OtherDeath {
851+ Killer : killer ,
852+ Weapon : weapon ,
853+ PenetratedObjects : int (data ["penetrated" ].GetValShort ()),
854+ NoScope : data ["noscope" ].GetValBool (),
855+ ThroughSmoke : data ["thrusmoke" ].GetValBool (),
856+ KillerBlind : data ["attackerblind" ].GetValBool (),
857+
858+ OtherType : otherType ,
859+ OtherID : otherID ,
860+ OtherPosition : otherPosition ,
861+ })
862+ }
863+
842864func (geh gameEventHandler ) itemEvent (data map [string ]* msg.CSVCMsg_GameEventKeyT ) (* common.Player , * common.Equipment ) {
843865 player := geh .playerByUserID32 (data ["userid" ].GetValShort ())
844866
0 commit comments