mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-15 16:34:39 +00:00
Check that weapon magzine is empty before sending WeaponDryFireMessage (#507)
This commit is contained in:
parent
5437b3f068
commit
8174a3351c
1 changed files with 10 additions and 1 deletions
|
|
@ -1973,7 +1973,16 @@ class WorldSessionActor extends Actor
|
||||||
|
|
||||||
case AvatarResponse.WeaponDryFire(weapon_guid) =>
|
case AvatarResponse.WeaponDryFire(weapon_guid) =>
|
||||||
if(tplayer_guid != 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) =>
|
case AvatarResponse.TerminalOrderResult(terminal_guid, action, result) =>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue