Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-12-02 16:58:22 +0000
committerStijn Buys <ingar@osirion.org>2012-12-02 16:58:22 +0000
commit150855111dd3042049a22d1c3a3d98f51afb336b (patch)
treeeee8f0a7ddf49d4957147eb15f0551af43ac2904
parentd972dd5d94469806c29cd7d11922acc00cb08337 (diff)
Have mines always explode on collision.
-rw-r--r--src/game/base/spacemine.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/game/base/spacemine.cc b/src/game/base/spacemine.cc
index 32d4798..865deb0 100644
--- a/src/game/base/spacemine.cc
+++ b/src/game/base/spacemine.cc
@@ -92,11 +92,11 @@ void SpaceMine::collision(core::Entity *other)
const float force = math::max(entity->mass(), entity->radius() * 100.0f);
entity->body()->applyCentralImpulse(math::to_btVector3(explosion_direction * force ));
- entity->body()->applyTorqueImpulse(math::to_btVector3(explosion_torque * force * 0.1f));
-
- spacemine_detonated_timestamp = core::game()->time();
+ entity->body()->applyTorqueImpulse(math::to_btVector3(explosion_torque * force * 0.1f));
}
+ spacemine_detonated_timestamp = core::game()->time();
+
set_state(core::Entity::Destroyed);
// this method is a bullet callback, we can not reset() here
}
@@ -111,7 +111,7 @@ void SpaceMine::frame(const unsigned long elapsed)
reset();
}
- if (core::game()->time() - spacemine_detonated_timestamp > 5) {
+ if (spacemine_detonated_timestamp + 5.0f < core::game()->time()) {
die();
}
}