From 1b1963e6d2d9a1b5b39c6e23240e09631ada0cbc Mon Sep 17 00:00:00 2001 From: Jocke Date: Mon, 14 Mar 2016 01:01:35 +0100 Subject: [PATCH] Reload for assault is only done once now. --- src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp index b58cf158..7b97689a 100644 --- a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp +++ b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp @@ -14,7 +14,19 @@ void AssaultWeaponBehaviour::UpdateWeapon(ComponentWrapper cWeapon, WeaponInfo& // Start reloading automatically if at 0 mag ammo Field magAmmo = cWeapon["MagazineAmmo"]; if (m_ConfigAutoReload && magAmmo <= 0) { - OnReload(cWeapon, wi); + //OnReload(cWeapon, wi); + // Send an input command instead of reloading immediately so the server + // has a chance to catch up. + if (IsClient) { + Events::InputCommand e; + e.Player = wi.Player; + e.PlayerID = -1; + e.Command = "Reload"; + e.Value = 1; + m_EventBroker->Publish(e); + e.Value = 0; + m_EventBroker->Publish(e); + } } // Only start reloading once we're done firing