From e472d9537ee7919630e5f6039f8425b06f6c4213 Mon Sep 17 00:00:00 2001 From: Aki Date: Tue, 8 Mar 2022 19:33:59 +0100 Subject: Replaced time funcs from Game with Clock equivalents This excludes time compression stuff, as it will need some more attention due to casting. I don't quite like the long invocations that go through game instance first then get the clock. It looks bad. I'll need to rethink how modules are being made available in the codebase. --- Stars45/Weapon.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Stars45/Weapon.cpp') diff --git a/Stars45/Weapon.cpp b/Stars45/Weapon.cpp index 4d3eaa5..2e35157 100644 --- a/Stars45/Weapon.cpp +++ b/Stars45/Weapon.cpp @@ -1145,7 +1145,7 @@ Weapon::CanLockPoint(const Point& test, double& az, double& el, Point* obj) void Weapon::AimTurret(double az, double el) { - double seconds = (Game::GetInstance()->GameTime() - aim_time) / 1000.0; + double seconds = (Game::GetInstance()->GetClock()->GameTime() - aim_time) / 1000.0; // don't let the weapon turn faster than turret slew rate: double max_turn = design->slew_rate * seconds; @@ -1170,7 +1170,7 @@ Weapon::AimTurret(double az, double el) old_azimuth = (float) az; old_elevation = (float) el; - aim_time = Game::GetInstance()->GameTime(); + aim_time = Game::GetInstance()->GetClock()->GameTime(); } void -- cgit v1.1