Defender ability HUD fixed

This commit is contained in:
viktorljung
2016-03-12 18:43:04 +01:00
parent 51b8846b3a
commit c0fc36845f
@@ -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()) {