summaryrefslogtreecommitdiffstats
path: root/src/physics
diff options
context:
space:
mode:
authorMrSimbax <simbaxlp@gmail.com>2014-03-08 23:20:39 +0100
committerMrSimbax <simbaxlp@gmail.com>2014-03-08 23:20:39 +0100
commit3dd400810f16657d1f99963f249a8b93f640fdd6 (patch)
tree01fcb1239034e35dbfe33bf4952c46692b7d6ed6 /src/physics
parenta61da7404bf8430132864d493c7e75a6b4c3d978 (diff)
downloadcolobot-3dd400810f16657d1f99963f249a8b93f640fdd6.tar.gz
colobot-3dd400810f16657d1f99963f249a8b93f640fdd6.tar.bz2
colobot-3dd400810f16657d1f99963f249a8b93f640fdd6.zip
Fixed bug from a61da7404bf8430132864d493c7e75a6b4c3d978
Moved ExploObject to CPhysics::EventFrame, it shouldn't crash anymore.
Diffstat (limited to 'src/physics')
-rw-r--r--src/physics/physics.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/physics/physics.cpp b/src/physics/physics.cpp
index c84040e..2ab7425 100644
--- a/src/physics/physics.cpp
+++ b/src/physics/physics.cpp
@@ -983,13 +983,6 @@ void CPhysics::MotorUpdate(float aTime, float rTime)
m_cirMotion.motorSpeed.y = 0.0f;
}
- if ( m_bLand && m_fallingHeight != 0.0f ) // if fell
- {
- float force = m_fallingHeight * m_fallDamageFraction;
- m_object->ExploObject(EXPLO_BOUM, force);
- m_fallingHeight = 0.0f;
- }
-
if ( m_type == TYPE_FLYING && m_bLand ) // flying on the ground?
{
if ( type == OBJECT_HUMAN ||
@@ -1621,6 +1614,13 @@ bool CPhysics::EventFrame(const Event &event)
MotorParticle(m_time, event.rTime);
SoundMotor(event.rTime);
+ if ( m_bLand && m_fallingHeight != 0.0f ) // if fell
+ {
+ float force = m_fallingHeight * m_fallDamageFraction;
+ m_object->ExploObject(EXPLO_BOUM, force);
+ m_fallingHeight = 0.0f;
+ }
+
m_bForceUpdate = false;
return true;