diff options
author | Stijn Buys <ingar@osirion.org> | 2012-12-02 16:58:22 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-12-02 16:58:22 +0000 |
commit | 150855111dd3042049a22d1c3a3d98f51afb336b (patch) | |
tree | eee8f0a7ddf49d4957147eb15f0551af43ac2904 /src/game/base | |
parent | d972dd5d94469806c29cd7d11922acc00cb08337 (diff) |
Have mines always explode on collision.
Diffstat (limited to 'src/game/base')
-rw-r--r-- | src/game/base/spacemine.cc | 8 |
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(); } } |