File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,11 @@ type WeaponFire struct {
157157 Weapon * common.Equipment
158158}
159159
160+ // WeaponReload signals that a player started to reload his weapon.
161+ type WeaponReload struct {
162+ Player * common.Player
163+ }
164+
160165// GrenadeEventIf is the interface for all GrenadeEvents (except GrenadeProjectile* events).
161166// Used to catch the different events with the same handler.
162167type GrenadeEventIf interface {
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ func newGameEventHandler(parser *Parser) gameEventHandler {
141141 "tournament_reward" : nil , // Dunno
142142 "weapon_fire" : geh .weaponFire , // Weapon was fired
143143 "weapon_fire_on_empty" : nil , // Sounds boring
144- "weapon_reload" : nil , // Weapon reloaded
144+ "weapon_reload" : geh . weaponReload , // Weapon reloaded
145145 "weapon_zoom" : nil , // Zooming in
146146 }
147147
@@ -247,6 +247,12 @@ func (geh gameEventHandler) weaponFire(data map[string]*msg.CSVCMsg_GameEventKey
247247 })
248248}
249249
250+ func (geh gameEventHandler ) weaponReload (data map [string ]* msg.CSVCMsg_GameEventKeyT ) {
251+ geh .dispatch (events.WeaponReload {
252+ Player : geh .playerByUserID32 (data ["userid" ].GetValShort ()),
253+ })
254+ }
255+
250256func (geh gameEventHandler ) playerDeath (data map [string ]* msg.CSVCMsg_GameEventKeyT ) {
251257 killer := geh .playerByUserID32 (data ["attacker" ].GetValShort ())
252258 wepType := common .MapEquipment (data ["weapon" ].GetValString ())
You can’t perform that action at this time.
0 commit comments