diff --git a/include/Game/Systems/Weapon/AssaultWeaponBehaviour.h b/include/Game/Systems/Weapon/AssaultWeaponBehaviour.h index 231cc020..5783cf31 100644 --- a/include/Game/Systems/Weapon/AssaultWeaponBehaviour.h +++ b/include/Game/Systems/Weapon/AssaultWeaponBehaviour.h @@ -38,7 +38,6 @@ private: //Camera cameraFromEntity(EntityWrapper camera); void CheckBoost(ComponentWrapper cWeapon, WeaponInfo& wi); - void RemoveBoostCheckHUD(WeaponInfo& wi); }; diff --git a/resources/Schema/Entities/FriendlyBoostBlueHUD.xml b/resources/Schema/Entities/FriendlyBoostBlueHUD.xml index 296560fa..c181392e 100644 --- a/resources/Schema/Entities/FriendlyBoostBlueHUD.xml +++ b/resources/Schema/Entities/FriendlyBoostBlueHUD.xml @@ -2,6 +2,9 @@ + + 0.5 + @@ -44,6 +47,7 @@ \1 Fonts/Hind-Edited.otf,64 + false @@ -56,7 +60,7 @@ \1 Fonts/Hind-Edited.otf,64 - + @@ -80,6 +84,7 @@ \2 Fonts/Hind-Edited.otf,64 + false @@ -92,7 +97,7 @@ \2 Fonts/Hind-Edited.otf,64 - + @@ -116,6 +121,7 @@ \3 Fonts/Hind-Edited.otf,64 + false @@ -128,7 +134,7 @@ \3 Fonts/Hind-Edited.otf,64 - + diff --git a/src/Game/Systems/BoostSystem.cpp b/src/Game/Systems/BoostSystem.cpp index 0aab545f..5a04e3f8 100644 --- a/src/Game/Systems/BoostSystem.cpp +++ b/src/Game/Systems/BoostSystem.cpp @@ -8,9 +8,7 @@ BoostSystem::BoostSystem(SystemParams params) bool BoostSystem::OnPlayerDamage(Events::PlayerDamage& e) { - if (!IsServer) { - return false; - } + if (e.Victim == e.Inflictor) { return false; @@ -35,6 +33,9 @@ bool BoostSystem::OnPlayerDamage(Events::PlayerDamage& e) if (className == "SidearmWeapon") { // give ammo giveAmmo(e.Inflictor, e.Victim); } else { //give boost + if (!IsServer) { + return false; + } //get the XML file, example: "Schema/Entities/BoostclassName.xml" std::string classXML = "Schema/Entities/" + className + ".xml"; diff --git a/src/Game/Systems/PlayerMovementSystem.cpp b/src/Game/Systems/PlayerMovementSystem.cpp index 35a7d3cf..d093ee21 100644 --- a/src/Game/Systems/PlayerMovementSystem.cpp +++ b/src/Game/Systems/PlayerMovementSystem.cpp @@ -393,7 +393,7 @@ void PlayerMovementSystem::spawnHexagon(EntityWrapper target) bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e) { EntityWrapper player(m_World, e.Player); - if (!player.Valid()){// || !IsClient || player.ID == LocalPlayer.ID) { + if (!player.Valid() || !IsClient || player.ID == LocalPlayer.ID) { return false; } diff --git a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp index 5a4af4f6..b58cf158 100644 --- a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp +++ b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp @@ -386,13 +386,11 @@ void AssaultWeaponBehaviour::CheckBoost(ComponentWrapper cWeapon, WeaponInfo& wi PickData pickData = m_Renderer->Pick(centerScreen); EntityWrapper victim(m_World, pickData.Entity); if (!victim.Valid()) { - RemoveBoostCheckHUD(wi); return; } // Don't let us somehow shoot ourselves in the foot if (victim == LocalPlayer) { - RemoveBoostCheckHUD(wi); return; } @@ -401,7 +399,6 @@ void AssaultWeaponBehaviour::CheckBoost(ComponentWrapper cWeapon, WeaponInfo& wi victim = victim.FirstParentWithComponent("Player"); } if (!victim.Valid()) { - RemoveBoostCheckHUD(wi); return; } @@ -463,6 +460,12 @@ void AssaultWeaponBehaviour::CheckBoost(ComponentWrapper cWeapon, WeaponInfo& wi } else { EntityWrapper friendlyBoostHud = friendlyBoostHudSpawner.FirstChildByName("FriendlyBoostHUD"); if (friendlyBoostHud.Valid()) { + if(friendlyBoostHud.HasComponent("Lifetime")) { + (Field)friendlyBoostHud["Lifetime"]["Lifetime"] = 0.5; + } + + + EntityWrapper assaultBoostEntity = friendlyBoostHud.FirstChildByName("AssaultBoost"); if (assaultBoostEntity.Valid()) { EntityWrapper active = assaultBoostEntity.FirstChildByName("Active"); @@ -504,10 +507,3 @@ void AssaultWeaponBehaviour::CheckBoost(ComponentWrapper cWeapon, WeaponInfo& wi } } -void AssaultWeaponBehaviour::RemoveBoostCheckHUD(WeaponInfo& wi) -{ - EntityWrapper friendlyBoostHudSpawner = wi.FirstPersonPlayerModel.FirstChildByName("FriendlyBoostAttachment"); - if (friendlyBoostHudSpawner.Valid()) { - friendlyBoostHudSpawner.DeleteChildren(); - } -}