diff options
Diffstat (limited to 'StarsEx/Weapon.cpp')
-rw-r--r-- | StarsEx/Weapon.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/StarsEx/Weapon.cpp b/StarsEx/Weapon.cpp index 77ac1fa..5316831 100644 --- a/StarsEx/Weapon.cpp +++ b/StarsEx/Weapon.cpp @@ -12,21 +12,25 @@ */ #include "Weapon.h" -#include "Shot.h" -#include "Drone.h" -#include "Contact.h" -#include "Ship.h" -#include "Sim.h" -#include "SimEvent.h" -#include "Random.h" -#include "NetGame.h" -#include "NetUtil.h" +#include <cstdint> + +#include <List.h> -#include "Game.h" #include "Clock.h" +#include "Contact.h" #include "ContentBundle.h" +#include "Drone.h" +#include "Game.h" +#include "NetGame.h" +#include "NetUtil.h" +#include "Random.h" +#include "Ship.h" +#include "Shot.h" +#include "SimEvent.h" +#include "Sim.h" #include "Solid.h" +#include "System.h" // +----------------------------------------------------------------------+ @@ -440,7 +444,7 @@ Weapon::SetSweep(int s) // +--------------------------------------------------------------------+ bool -Weapon::CanTarget(DWORD classification) const +Weapon::CanTarget(std::uint32_t classification) const { return (design->target_type & classification) ? true : false; } @@ -694,7 +698,7 @@ Weapon::NetFirePrimary(SimObject* tgt, System* sub, int count) } Shot* -Weapon::NetFireSecondary(SimObject* tgt, System* sub, DWORD objid) +Weapon::NetFireSecondary(SimObject* tgt, System* sub, std::uint32_t objid) { Shot* shot = 0; @@ -1145,7 +1149,7 @@ Weapon::CanLockPoint(const Point& test, double& az, double& el, Point* obj) void Weapon::AimTurret(double az, double el) { - double seconds = (Clock::GetInstance()->GameTime() - aim_time) / 1000.0; + const auto seconds = static_cast<double>(Clock::GetInstance()->GameTime() - aim_time) / 1000.0; // don't let the weapon turn faster than turret slew rate: double max_turn = design->slew_rate * seconds; |