diff options
author | Aki <please@ignore.pl> | 2022-02-18 23:54:30 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-02-18 23:54:30 +0100 |
commit | 0052edae47d1e6ae613497c524719eff5838f52a (patch) | |
tree | 3ba92a7846374ba274cba38d924e65f7c2ceb344 /Stars45/Weapon.cpp | |
parent | 2ae135bbe43065978a4659278d18d9533d8a3b27 (diff) | |
download | starshatter-0052edae47d1e6ae613497c524719eff5838f52a.zip starshatter-0052edae47d1e6ae613497c524719eff5838f52a.tar.gz starshatter-0052edae47d1e6ae613497c524719eff5838f52a.tar.bz2 |
Switched to use GetIntance for Game instead of static methods
Diffstat (limited to 'Stars45/Weapon.cpp')
-rw-r--r-- | Stars45/Weapon.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
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 |