From 3451b7a13b7a2567c960022111c0f9617fbc7340 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 20 Aug 2009 12:51:15 +0000 Subject: initialize unitialized variables --- src/game/base/jumppoint.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/game/base') diff --git a/src/game/base/jumppoint.cc b/src/game/base/jumppoint.cc index 5b4e689..270275f 100644 --- a/src/game/base/jumppoint.cc +++ b/src/game/base/jumppoint.cc @@ -82,6 +82,8 @@ JumpGate::JumpGate() : JumpPoint() entity_moduletypeid = jumpgate_enttype; entity_state = core::Entity::NoPower; + + jumpgate_timer = 0; } JumpGate::~JumpGate() @@ -143,12 +145,13 @@ void JumpGate::activate() void JumpGate::frame(float elapsed) { - if (jumpgate_timer > 0) + if (jumpgate_timer > 0) { jumpgate_timer -= elapsed; - if (jumpgate_timer < 0) { - set_state(core::Entity::NoPower); - jumpgate_timer = 0; + if (jumpgate_timer < 0) { + set_state(core::Entity::NoPower); + jumpgate_timer = 0; + } } } -- cgit v1.2.3