mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-01-19 18:14:44 +00:00
Check that weapon magzine is empty before sending WeaponDryFireMessage (#507)
This commit is contained in:
parent
5437b3f068
commit
8174a3351c
|
|
@ -1973,7 +1973,16 @@ class WorldSessionActor extends Actor
|
|||
|
||||
case AvatarResponse.WeaponDryFire(weapon_guid) =>
|
||||
if(tplayer_guid != guid) {
|
||||
sendResponse(WeaponDryFireMessage(weapon_guid))
|
||||
// Check that the magazine is still empty before sending WeaponDryFireMessage
|
||||
// As it could have been reloaded since the packet was dispatched, which would make other clients not see it firing
|
||||
continent.GUID(weapon_guid) match {
|
||||
case Some(tool : Tool) => {
|
||||
if(tool.Magazine == 0) {
|
||||
sendResponse(WeaponDryFireMessage(weapon_guid))
|
||||
}
|
||||
}
|
||||
case _ => log.warn(s"Tried to send WeaponDryFire but GUID ${weapon_guid} does not seem to be a Tool")
|
||||
}
|
||||
}
|
||||
|
||||
case AvatarResponse.TerminalOrderResult(terminal_guid, action, result) =>
|
||||
|
|
|
|||
Loading…
Reference in a new issue