diff --git a/rts/Sim/Weapons/BeamLaser.cpp b/rts/Sim/Weapons/BeamLaser.cpp index 87d7e79df45..ad6139fbe9a 100644 --- a/rts/Sim/Weapons/BeamLaser.cpp +++ b/rts/Sim/Weapons/BeamLaser.cpp @@ -3,6 +3,7 @@ #include "BeamLaser.h" #include "PlasmaRepulser.h" #include "WeaponDef.h" +#include "WeaponMemPool.h" #include "Game/GameHelper.h" #include "Game/TraceRay.h" #include "Map/Ground.h" diff --git a/rts/Sim/Weapons/BombDropper.cpp b/rts/Sim/Weapons/BombDropper.cpp index aa821a15ff3..ffa9a9d3308 100644 --- a/rts/Sim/Weapons/BombDropper.cpp +++ b/rts/Sim/Weapons/BombDropper.cpp @@ -2,6 +2,7 @@ #include "BombDropper.h" #include "WeaponDef.h" +#include "WeaponMemPool.h" #include "Game/GameHelper.h" #include "Sim/Misc/GlobalSynced.h" #include "Sim/Misc/Team.h" diff --git a/rts/Sim/Weapons/Cannon.cpp b/rts/Sim/Weapons/Cannon.cpp index a981616abd4..4a2a6ff66aa 100644 --- a/rts/Sim/Weapons/Cannon.cpp +++ b/rts/Sim/Weapons/Cannon.cpp @@ -1,6 +1,8 @@ /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */ #include "Cannon.h" +#include "WeaponDef.h" +#include "WeaponMemPool.h" #include "Game/TraceRay.h" #include "Map/Ground.h" #include "Map/MapInfo.h" @@ -9,7 +11,6 @@ #include "Sim/Projectiles/WeaponProjectiles/WeaponProjectileFactory.h" #include "Sim/Units/Unit.h" #include "System/Sync/SyncTracer.h" -#include "WeaponDefHandler.h" #include "System/myMath.h" #include "System/FastMath.h" diff --git a/rts/Sim/Weapons/DGunWeapon.cpp b/rts/Sim/Weapons/DGunWeapon.cpp index 8144cfd8986..0530c433028 100644 --- a/rts/Sim/Weapons/DGunWeapon.cpp +++ b/rts/Sim/Weapons/DGunWeapon.cpp @@ -2,6 +2,7 @@ #include "DGunWeapon.h" #include "WeaponDef.h" +#include "WeaponMemPool.h" #include "Sim/Misc/GlobalSynced.h" #include "Sim/Projectiles/WeaponProjectiles/WeaponProjectileFactory.h" #include "Sim/Units/Unit.h" @@ -10,13 +11,6 @@ CR_BIND_DERIVED_POOL(CDGunWeapon, CWeapon, , weaponMemPool.alloc, weaponMemPool. CR_REG_METADATA(CDGunWeapon, ) -float CDGunWeapon::GetPredictedImpactTime(float3 p) const -{ - // user has to manually predict - return 0; -} - - void CDGunWeapon::FireImpl(const bool scriptCall) { float3 dir = wantedDir; diff --git a/rts/Sim/Weapons/DGunWeapon.h b/rts/Sim/Weapons/DGunWeapon.h index 4003ab6079a..b80dde9eb36 100644 --- a/rts/Sim/Weapons/DGunWeapon.h +++ b/rts/Sim/Weapons/DGunWeapon.h @@ -12,7 +12,7 @@ class CDGunWeapon: public CWeapon CDGunWeapon(CUnit* owner = nullptr, const WeaponDef* def = nullptr): CWeapon(owner, def) {} void Fire(); - float GetPredictedImpactTime(float3 p) const override final; + float GetPredictedImpactTime(float3 p) const override final { return 0.0f; } void Init() override final; private: diff --git a/rts/Sim/Weapons/EmgCannon.cpp b/rts/Sim/Weapons/EmgCannon.cpp index 18611bc3ae9..7cbd548cb69 100644 --- a/rts/Sim/Weapons/EmgCannon.cpp +++ b/rts/Sim/Weapons/EmgCannon.cpp @@ -3,8 +3,9 @@ #include "EmgCannon.h" #include "WeaponDef.h" -#include "Sim/Misc/Team.h" +#include "WeaponMemPool.h" #include "Map/Ground.h" +#include "Sim/Misc/Team.h" #include "Sim/Projectiles/WeaponProjectiles/WeaponProjectileFactory.h" #include "Sim/Units/Unit.h" #include "Sim/Units/UnitDef.h" @@ -20,10 +21,9 @@ void CEmgCannon::FireImpl(const bool scriptCall) float3 dir = currentTargetPos - weaponMuzzlePos; const float dist = dir.LengthNormalize(); - if (onlyForward && owner->unitDef->IsStrafingAirUnit()) { - // [?] StrafeAirMoveType cannot align itself properly, change back when that is fixed + // [?] StrafeAirMoveType cannot align itself properly, change back when that is fixed + if (onlyForward && owner->unitDef->IsStrafingAirUnit()) dir = owner->frontdir; - } dir += (gsRNG.NextVector() * SprayAngleExperience() + SalvoErrorExperience()); dir.Normalize(); diff --git a/rts/Sim/Weapons/FlameThrower.cpp b/rts/Sim/Weapons/FlameThrower.cpp index 5ebc45838fb..f02b944112c 100644 --- a/rts/Sim/Weapons/FlameThrower.cpp +++ b/rts/Sim/Weapons/FlameThrower.cpp @@ -3,6 +3,7 @@ #include "FlameThrower.h" #include "WeaponDef.h" +#include "WeaponMemPool.h" #include "Map/Ground.h" #include "Sim/Projectiles/WeaponProjectiles/WeaponProjectileFactory.h" #include "Sim/Units/Unit.h" diff --git a/rts/Sim/Weapons/LaserCannon.cpp b/rts/Sim/Weapons/LaserCannon.cpp index 673c0de2552..6f5ff40ffc9 100644 --- a/rts/Sim/Weapons/LaserCannon.cpp +++ b/rts/Sim/Weapons/LaserCannon.cpp @@ -2,6 +2,7 @@ #include "LaserCannon.h" #include "WeaponDef.h" +#include "WeaponMemPool.h" #include "Map/Ground.h" #include "Sim/Projectiles/WeaponProjectiles/WeaponProjectileFactory.h" #include "Sim/Units/Unit.h" @@ -13,8 +14,7 @@ CR_REG_METADATA(CLaserCannon,( CR_MEMBER(color) )) -CLaserCannon::CLaserCannon(CUnit* owner, const WeaponDef* def) - : CWeapon(owner, def) +CLaserCannon::CLaserCannon(CUnit* owner, const WeaponDef* def): CWeapon(owner, def) { //happens when loading if (def != nullptr) diff --git a/rts/Sim/Weapons/LightningCannon.cpp b/rts/Sim/Weapons/LightningCannon.cpp index bb9d9b6a739..d5d971bfc12 100644 --- a/rts/Sim/Weapons/LightningCannon.cpp +++ b/rts/Sim/Weapons/LightningCannon.cpp @@ -3,6 +3,7 @@ #include "LightningCannon.h" #include "PlasmaRepulser.h" #include "WeaponDef.h" +#include "WeaponMemPool.h" #include "Game/GameHelper.h" #include "Game/TraceRay.h" #include "Sim/Misc/CollisionHandler.h" diff --git a/rts/Sim/Weapons/MeleeWeapon.cpp b/rts/Sim/Weapons/MeleeWeapon.cpp index 329e7c2f8f4..cbd28e2bf3c 100644 --- a/rts/Sim/Weapons/MeleeWeapon.cpp +++ b/rts/Sim/Weapons/MeleeWeapon.cpp @@ -2,6 +2,7 @@ #include "MeleeWeapon.h" #include "WeaponDef.h" +#include "WeaponMemPool.h" #include "Sim/Units/Unit.h" CR_BIND_DERIVED_POOL(CMeleeWeapon, CWeapon, , weaponMemPool.alloc, weaponMemPool.free) diff --git a/rts/Sim/Weapons/MissileLauncher.cpp b/rts/Sim/Weapons/MissileLauncher.cpp index ddf0cc3a91e..a01d87c9e6e 100644 --- a/rts/Sim/Weapons/MissileLauncher.cpp +++ b/rts/Sim/Weapons/MissileLauncher.cpp @@ -3,6 +3,7 @@ #include "MissileLauncher.h" #include "WeaponDef.h" +#include "WeaponMemPool.h" #include "Game/TraceRay.h" #include "Map/Ground.h" #include "Sim/Projectiles/WeaponProjectiles/WeaponProjectileFactory.h" diff --git a/rts/Sim/Weapons/NoWeapon.cpp b/rts/Sim/Weapons/NoWeapon.cpp index 65f935d4338..d7634ea60ad 100644 --- a/rts/Sim/Weapons/NoWeapon.cpp +++ b/rts/Sim/Weapons/NoWeapon.cpp @@ -1,6 +1,7 @@ /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */ #include "NoWeapon.h" +#include "WeaponMemPool.h" CR_BIND_DERIVED_POOL(CNoWeapon, CWeapon, , weaponMemPool.alloc, weaponMemPool.free) CR_REG_METADATA(CNoWeapon, ) diff --git a/rts/Sim/Weapons/PlasmaRepulser.cpp b/rts/Sim/Weapons/PlasmaRepulser.cpp index 24527fe633a..9a1608e4b17 100644 --- a/rts/Sim/Weapons/PlasmaRepulser.cpp +++ b/rts/Sim/Weapons/PlasmaRepulser.cpp @@ -3,6 +3,7 @@ #include "System/creg/STL_List.h" #include "System/creg/STL_Set.h" #include "PlasmaRepulser.h" +#include "WeaponMemPool.h" #include "Sim/Misc/GlobalSynced.h" #include "Sim/Misc/QuadField.h" #include "Sim/Misc/TeamHandler.h" diff --git a/rts/Sim/Weapons/Rifle.cpp b/rts/Sim/Weapons/Rifle.cpp index d051a0a96a2..25a1287568c 100644 --- a/rts/Sim/Weapons/Rifle.cpp +++ b/rts/Sim/Weapons/Rifle.cpp @@ -2,6 +2,7 @@ #include "Rifle.h" #include "WeaponDef.h" +#include "WeaponMemPool.h" #include "Game/TraceRay.h" #include "Game/GameHelper.h" #include "Map/Ground.h" diff --git a/rts/Sim/Weapons/StarburstLauncher.cpp b/rts/Sim/Weapons/StarburstLauncher.cpp index 450ed936fcd..353244b1d37 100644 --- a/rts/Sim/Weapons/StarburstLauncher.cpp +++ b/rts/Sim/Weapons/StarburstLauncher.cpp @@ -2,6 +2,7 @@ #include "StarburstLauncher.h" #include "WeaponDef.h" +#include "WeaponMemPool.h" #include "Game/TraceRay.h" #include "Map/Ground.h" #include "Sim/Projectiles/WeaponProjectiles/WeaponProjectileFactory.h" diff --git a/rts/Sim/Weapons/TorpedoLauncher.cpp b/rts/Sim/Weapons/TorpedoLauncher.cpp index b4eaa7477c3..bf75de5e9df 100644 --- a/rts/Sim/Weapons/TorpedoLauncher.cpp +++ b/rts/Sim/Weapons/TorpedoLauncher.cpp @@ -3,6 +3,7 @@ #include "TorpedoLauncher.h" #include "WeaponDef.h" +#include "WeaponMemPool.h" #include "Map/Ground.h" #include "Sim/Projectiles/WeaponProjectiles/WeaponProjectileFactory.h" #include "Sim/Units/UnitDef.h" diff --git a/rts/Sim/Weapons/Weapon.cpp b/rts/Sim/Weapons/Weapon.cpp index 028945cd370..4c0ca0f1ee1 100644 --- a/rts/Sim/Weapons/Weapon.cpp +++ b/rts/Sim/Weapons/Weapon.cpp @@ -2,6 +2,7 @@ #include "Weapon.h" #include "WeaponDefHandler.h" +#include "WeaponMemPool.h" #include "Game/GameHelper.h" #include "Game/TraceRay.h" #include "Game/Players/Player.h" diff --git a/rts/Sim/Weapons/Weapon.h b/rts/Sim/Weapons/Weapon.h index 53d6d0ac481..9eac65abb5b 100644 --- a/rts/Sim/Weapons/Weapon.h +++ b/rts/Sim/Weapons/Weapon.h @@ -8,7 +8,6 @@ #include "System/Object.h" #include "Sim/Misc/DamageArray.h" #include "Sim/Projectiles/ProjectileParams.h" -#include "Sim/Weapons/WeaponMemPool.h" #include "Sim/Weapons/WeaponTarget.h" #include "System/float3.h"