Skip to content

Commit 6ede798

Browse files
committed
fixed water DieModule check
1 parent 8058c07 commit 6ede798

2 files changed

Lines changed: 19 additions & 8 deletions

File tree

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/DieModule.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,11 @@
3737
#include "GameLogic/GameLogic.h"
3838
#include "GameLogic/Module/DieModule.h"
3939
#include "GameLogic/Object.h"
40-
#include <GameLogic/TerrainLogic.h>
41-
42-
43-
40+
#include "GameLogic/TerrainLogic.h"
4441

4542

43+
// Way higher than map size will allow
44+
constexpr Real defaultMaxWaterDepth {10000.0};
4645

4746
//-------------------------------------------------------------------------------------------------
4847
DieMuxData::DieMuxData() {
@@ -53,7 +52,7 @@ DieMuxData::DieMuxData() {
5352
m_deathTypes &= ~TheGlobalData->m_defaultExcludedDeathTypes;
5453
}
5554
m_minWaterDepth = 0.0f;
56-
m_maxWaterDepth = std::numeric_limits<Real>::infinity();
55+
m_maxWaterDepth = defaultMaxWaterDepth;
5756
}
5857

5958
//-------------------------------------------------------------------------------------------------
@@ -92,9 +91,9 @@ Bool DieMuxData::isDieApplicable(const Object* obj, const DamageInfo *damageInfo
9291
if( m_requiredStatus.any() && !obj->getStatusBits().testForAll( m_requiredStatus ) )
9392
return false;
9493

95-
if ((m_minWaterDepth > 0.0f || m_maxWaterDepth < std::numeric_limits<Short>::infinity()) && obj != nullptr) {
94+
if ((m_minWaterDepth > 0.0f || m_maxWaterDepth < defaultMaxWaterDepth) && obj != nullptr) {
9695

97-
// if on bride and we need water -> not applicable
96+
// if on bridge and we need water -> not applicable
9897
if (obj->getLayer() > LAYER_GROUND && m_minWaterDepth > 0.0f) {
9998
return false;
10099
}

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ShipSlowDeathBehavior.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,19 @@ ShipSlowDeathBehaviorModuleData::ShipSlowDeathBehaviorModuleData( void )
157157
ShipSlowDeathBehavior::ShipSlowDeathBehavior( Thing *thing, const ModuleData *moduleData )
158158
: SlowDeathBehavior( thing, moduleData )
159159
{
160-
160+
m_deathSound = AudioEventRTS();
161+
m_initStartFrame = 0;
162+
m_toppleStartFrame = 0;
163+
m_sinkStartFrame = 0;
164+
m_shipSinkStarted = false;
165+
m_chosenToppleType = 0;
166+
167+
m_toppleVarianceRoll = 0.0f;
168+
169+
m_curPitch = 0.0f;
170+
m_curYaw = 0.0f;
171+
m_curRoll = 0.0f;
172+
m_curZ = 0.0f;
161173
}
162174

163175
//-------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)