From c0fc36845ffe9525371661584429b8f8a5d861e3 Mon Sep 17 00:00:00 2001 From: viktorljung Date: Sat, 12 Mar 2016 18:43:04 +0100 Subject: [PATCH] Defender ability HUD fixed --- src/Game/Systems/Weapon/DefenderWeaponBehaviour.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Game/Systems/Weapon/DefenderWeaponBehaviour.cpp b/src/Game/Systems/Weapon/DefenderWeaponBehaviour.cpp index f342f291..f33eea26 100644 --- a/src/Game/Systems/Weapon/DefenderWeaponBehaviour.cpp +++ b/src/Game/Systems/Weapon/DefenderWeaponBehaviour.cpp @@ -152,6 +152,13 @@ bool DefenderWeaponBehaviour::OnInputCommand(ComponentWrapper cWeapon, WeaponInf EntityWrapper attachment = wi.Player.FirstChildByName("ShieldAttachment"); if (attachment.Valid()) { if (e.Value > 0) { + + if(wi.Player.Valid()) { + if(wi.Player.HasComponent("ShieldAbility")) { + (bool&)wi.Player["ShieldAbility"]["Active"] = true; + } + } + if (IsServer) { SpawnerSystem::Spawn(attachment, attachment); } @@ -214,6 +221,12 @@ bool DefenderWeaponBehaviour::OnInputCommand(ComponentWrapper cWeapon, WeaponInf } else { attachment.DeleteChildren(); + if (wi.Player.Valid()) { + if (wi.Player.HasComponent("ShieldAbility")) { + (bool&)wi.Player["ShieldAbility"]["Active"] = false; + } + } + if (IsClient) { EntityWrapper root = wi.FirstPersonEntity; if (root.Valid()) {