diff options
Diffstat (limited to 'src/game/base')
-rw-r--r-- | src/game/base/jumppoint.cc | 14 | ||||
-rw-r--r-- | src/game/base/jumppoint.h | 4 | ||||
-rw-r--r-- | src/game/base/ship.cc | 4 | ||||
-rw-r--r-- | src/game/base/ship.h | 4 |
4 files changed, 12 insertions, 14 deletions
diff --git a/src/game/base/jumppoint.cc b/src/game/base/jumppoint.cc index 80c99ef..3d9fd01 100644 --- a/src/game/base/jumppoint.cc +++ b/src/game/base/jumppoint.cc @@ -179,19 +179,17 @@ void JumpGate::func_dock(Ship *ship) void JumpGate::activate() { - jumpgate_timer = jump_timer_delay; + jumpgate_timer = jump_timer_delay * 1000; set_state(core::Entity::Normal); } -void JumpGate::frame(float elapsed) +void JumpGate::frame(const unsigned long elapsed) { - if (jumpgate_timer > 0) { + if (jumpgate_timer > elapsed) { jumpgate_timer -= elapsed; - - if (jumpgate_timer < 0) { - set_state(core::Entity::NoPower); - jumpgate_timer = 0; - } + } else if (state() != core::Entity::NoPower) { + set_state(core::Entity::NoPower); + jumpgate_timer = 0; } } diff --git a/src/game/base/jumppoint.h b/src/game/base/jumppoint.h index 40f9e5d..33a9f9f 100644 --- a/src/game/base/jumppoint.h +++ b/src/game/base/jumppoint.h @@ -75,14 +75,14 @@ public: void activate(); - virtual void frame(float elapsed); + virtual void frame(const unsigned long elapsed); static inline void set_template (const Template *entitytemplate) { jumpgate_template = entitytemplate; } private: - float jumpgate_timer; + unsigned long jumpgate_timer; static const Template *jumpgate_template; }; diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc index 0fa44fb..7a499c3 100644 --- a/src/game/base/ship.cc +++ b/src/game/base/ship.cc @@ -365,7 +365,7 @@ void Ship::action (btScalar seconds) } } -void Ship::frame(float seconds) +void Ship::frame(const unsigned long elapsed) { //const float direction_reaction = 2.0f; // directional control reaction time //const float thrust_reaction = 0.5f; // thrust control reaction time @@ -646,7 +646,7 @@ void Ship::frame(float seconds) } */ - EntityControlable::frame(seconds); + EntityControlable::frame(elapsed); } diff --git a/src/game/base/ship.h b/src/game/base/ship.h index b0256aa..37dae0d 100644 --- a/src/game/base/ship.h +++ b/src/game/base/ship.h @@ -53,11 +53,11 @@ public: return ship_roll_force; } - /// physices frame + /// physics frame virtual void action (btScalar seconds); /// game frame - virtual void frame(float seconds); + virtual void frame(const unsigned long elapsed); /// move the ship to a different zone virtual void set_zone(core::Zone *zone); |