parent
fbe2bf8bc7
commit
a61da7404b
|
@ -112,7 +112,7 @@ CApplication::CApplication()
|
||||||
m_debugModes = 0;
|
m_debugModes = 0;
|
||||||
m_customDataPath = false;
|
m_customDataPath = false;
|
||||||
|
|
||||||
m_windowTitle = "COLOBOT";
|
m_windowTitle = "COLOBOT GOLD";
|
||||||
|
|
||||||
m_simulationSuspended = false;
|
m_simulationSuspended = false;
|
||||||
|
|
||||||
|
|
|
@ -107,6 +107,9 @@ CPhysics::CPhysics(CObject* object)
|
||||||
m_bFreeze = false;
|
m_bFreeze = false;
|
||||||
m_bForceUpdate = true;
|
m_bForceUpdate = true;
|
||||||
m_bLowLevel = false;
|
m_bLowLevel = false;
|
||||||
|
m_fallingHeight = 0.0f;
|
||||||
|
m_fallDamageFraction = 0.0f;
|
||||||
|
m_minFallingHeight = 0.0f;
|
||||||
|
|
||||||
memset(&m_linMotion, 0, sizeof(Motion));
|
memset(&m_linMotion, 0, sizeof(Motion));
|
||||||
memset(&m_cirMotion, 0,sizeof(Motion));
|
memset(&m_cirMotion, 0,sizeof(Motion));
|
||||||
|
@ -912,9 +915,15 @@ void CPhysics::MotorUpdate(float aTime, float rTime)
|
||||||
if ( m_reactorRange < 0.5f ) m_bLowLevel = true;
|
if ( m_reactorRange < 0.5f ) m_bLowLevel = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_minFallingHeight = 20.0f;
|
||||||
|
m_fallDamageFraction = 0.007f;
|
||||||
|
|
||||||
if ( m_reactorRange == 0.0f ) // reactor tilt?
|
if ( m_reactorRange == 0.0f ) // reactor tilt?
|
||||||
{
|
{
|
||||||
motorSpeed.y = -1.0f; // grave
|
motorSpeed.y = -1.0f; // grave
|
||||||
|
|
||||||
|
if (m_fallingHeight == 0.0f && m_floorHeight >= m_minFallingHeight)
|
||||||
|
m_fallingHeight = m_floorHeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -974,6 +983,13 @@ void CPhysics::MotorUpdate(float aTime, float rTime)
|
||||||
m_cirMotion.motorSpeed.y = 0.0f;
|
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 ( m_type == TYPE_FLYING && m_bLand ) // flying on the ground?
|
||||||
{
|
{
|
||||||
if ( type == OBJECT_HUMAN ||
|
if ( type == OBJECT_HUMAN ||
|
||||||
|
|
|
@ -248,5 +248,8 @@ protected:
|
||||||
bool m_bSoundSlow;
|
bool m_bSoundSlow;
|
||||||
bool m_bForceUpdate;
|
bool m_bForceUpdate;
|
||||||
bool m_bLowLevel;
|
bool m_bLowLevel;
|
||||||
|
float m_fallingHeight;
|
||||||
|
float m_fallDamageFraction;
|
||||||
|
float m_minFallingHeight;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue