From 0052edae47d1e6ae613497c524719eff5838f52a Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 18 Feb 2022 23:54:30 +0100 Subject: Switched to use GetIntance for Game instead of static methods --- Stars45/Weapon.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Stars45/Weapon.cpp') diff --git a/Stars45/Weapon.cpp b/Stars45/Weapon.cpp index 406a151..45483a0 100644 --- a/Stars45/Weapon.cpp +++ b/Stars45/Weapon.cpp @@ -45,9 +45,9 @@ Weapon::Weapon(WeaponDesign* d, int nmuz, Vec3* muzzles, double az, double el) ZeroMemory(visible_stores, sizeof(visible_stores)); if (design->primary) - abrv = Game::GetText("sys.weapon.primary.abrv"); + abrv = Game::GetInstance()->GetText("sys.weapon.primary.abrv"); else - abrv = Game::GetText("sys.weapon.secondary.abrv"); + abrv = Game::GetInstance()->GetText("sys.weapon.secondary.abrv"); nbarrels = nmuz; @@ -375,7 +375,7 @@ Weapon::Distribute(double delivered_energy, double seconds) energy = (float) (delivered_energy/seconds); } - else if (!Game::Paused()) { + else if (!Game::GetInstance()->Paused()) { energy += (float) (delivered_energy * 1.25); if (energy > capacity) @@ -589,7 +589,7 @@ Weapon::Track(SimObject* targ, System* sub) Shot* Weapon::Fire() { - if (Game::Paused()) + if (Game::GetInstance()->Paused()) return 0; if (ship && ship->CheckFire()) @@ -667,7 +667,7 @@ Weapon::NetFirePrimary(SimObject* tgt, System* sub, int count) { Shot* shot = 0; - if (!IsPrimary() || Game::Paused()) + if (!IsPrimary() || Game::GetInstance()->Paused()) return shot; if (active_barrel < 0 || active_barrel >= nbarrels) @@ -697,7 +697,7 @@ Weapon::NetFireSecondary(SimObject* tgt, System* sub, DWORD objid) { Shot* shot = 0; - if (IsPrimary() || Game::Paused()) + if (IsPrimary() || Game::GetInstance()->Paused()) return shot; if (active_barrel < 0 || active_barrel >= nbarrels) @@ -732,7 +732,7 @@ Weapon::FireBarrel(int n) Shot* shot = 0; SimRegion* region = ship->GetRegion(); - if (!region || n < 0 || n >= nbarrels || Game::Paused()) + if (!region || n < 0 || n >= nbarrels || Game::GetInstance()->Paused()) return 0; firing = 1; @@ -1144,7 +1144,7 @@ Weapon::CanLockPoint(const Point& test, double& az, double& el, Point* obj) void Weapon::AimTurret(double az, double el) { - double seconds = (Game::GameTime() - aim_time) / 1000.0; + double seconds = (Game::GetInstance()->GameTime() - aim_time) / 1000.0; // don't let the weapon turn faster than turret slew rate: double max_turn = design->slew_rate * seconds; @@ -1169,7 +1169,7 @@ Weapon::AimTurret(double az, double el) old_azimuth = (float) az; old_elevation = (float) el; - aim_time = Game::GameTime(); + aim_time = Game::GetInstance()->GameTime(); } void -- cgit v1.1