Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1279,6 +1279,8 @@ void OpenContain::orderAllPassengersToExit( CommandSourceType commandSource )
//-------------------------------------------------------------------------------------------------
void OpenContain::processDamageToContained()
{
const OpenContainModuleData* data = getOpenContainModuleData();

#if RETAIL_COMPATIBLE_CRC

const ContainedItemsList* items = getContainedItemsList();
Expand All @@ -1292,7 +1294,7 @@ void OpenContain::processDamageToContained()
Object *object = *it++;

//Calculate the damage to be inflicted on each unit.
Real damage = object->getBodyModule()->getMaxHealth() * getOpenContainModuleData()->m_damagePercentageToUnits;
Real damage = object->getBodyModule()->getMaxHealth() * data->m_damagePercentageToUnits;

DamageInfo damageInfo;
damageInfo.in.m_damageType = DAMAGE_UNRESISTABLE;
Expand All @@ -1301,7 +1303,7 @@ void OpenContain::processDamageToContained()
damageInfo.in.m_amount = damage;
object->attemptDamage( &damageInfo );

if( !object->isEffectivelyDead() && getOpenContainModuleData()->m_damagePercentageToUnits == 1.0f )
if( !object->isEffectivelyDead() && data->m_damagePercentageToUnits == 1.0f )
object->kill(); // in case we are carrying flame proof troops we have been asked to kill

// TheSuperHackers @info Calls to Object::attemptDamage and Object::kill will not remove
Expand Down Expand Up @@ -1349,16 +1351,16 @@ void OpenContain::processDamageToContained()
DEBUG_ASSERTCRASH( object, ("Contain list must not contain NULL element") );

// Calculate the damage to be inflicted on each unit.
Real damage = object->getBodyModule()->getMaxHealth() * percentDamage;
Real damage = object->getBodyModule()->getMaxHealth() * data->m_damagePercentageToUnits;

DamageInfo damageInfo;
damageInfo.in.m_damageType = DAMAGE_UNRESISTABLE;
damageInfo.in.m_deathType = data->m_isBurnedDeathToUnits ? DEATH_BURNED : DEATH_NORMAL;
damageInfo.in.m_deathType = DEATH_BURNED;

@Mauller Mauller Aug 3, 2025

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks like it alters behaviour, is the damage always set to true for burned to death?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change seems correct - damageInfo.in.m_deathType = DEATH_BURNED; was the original line in Generals. I gather the non-retail compatible block introduced here in #1019 was copied from the Zero Hour version.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the compile errors happened because I just slapped the diff to Generals without checking if it is ABI compatible.

damageInfo.in.m_sourceID = getObject()->getID();
damageInfo.in.m_amount = damage;
object->attemptDamage( &damageInfo );

if( !object->isEffectivelyDead() && percentDamage == 1.0f )
if( !object->isEffectivelyDead() && data->m_damagePercentageToUnits == 1.0f )
object->kill(); // in case we are carrying flame proof troops we have been asked to kill

if ( object->isEffectivelyDead() )
Expand Down
Loading