mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Fixed vehicle body not properly removed when destroyed during ramming (#210)
This commit is contained in:
@@ -10700,6 +10700,22 @@ UINT8 SOLDIERTYPE::SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sBr
|
||||
return(ubCombinedLoss);
|
||||
}
|
||||
|
||||
void SOLDIERTYPE::SoldierTakeDelayedDamage(INT8 bHeight, INT16 sLifeDeduct, INT16 sBreathLoss, UINT8 ubReason, UINT8 ubAttacker, INT32 sSourceGrid, INT16 sSubsequent, BOOLEAN fShowDamage)
|
||||
{
|
||||
delayedDamageFunction = [this, bHeight, sLifeDeduct, sBreathLoss, ubReason, ubAttacker, sSourceGrid, sSubsequent, fShowDamage]()
|
||||
{
|
||||
this->SoldierTakeDamage(bHeight, sLifeDeduct, sBreathLoss, ubReason, ubAttacker, sSourceGrid, sSubsequent, fShowDamage);
|
||||
};
|
||||
}
|
||||
|
||||
void SOLDIERTYPE::ResolveDelayedDamage()
|
||||
{
|
||||
if (delayedDamageFunction)
|
||||
{
|
||||
delayedDamageFunction();
|
||||
delayedDamageFunction = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
extern BOOLEAN IsMercSayingDialogue( UINT8 ubProfileID );
|
||||
|
||||
@@ -11499,6 +11515,8 @@ void SOLDIERTYPE::MoveMerc( FLOAT dMovementChange, FLOAT dAngle, BOOLEAN fCheckR
|
||||
// OK, set new position
|
||||
this->EVENT_InternalSetSoldierPosition( dXPos, dYPos, FALSE, FALSE, FALSE );
|
||||
|
||||
this->ResolveDelayedDamage();
|
||||
|
||||
// Flugente: drag people
|
||||
if ( currentlydragging )
|
||||
{
|
||||
@@ -26234,4 +26252,6 @@ void SOLDIERTYPE::InitializeExtraData(void)
|
||||
this->ubQuickItemSlot = 0;
|
||||
|
||||
this->usGrenadeItem = 0;
|
||||
|
||||
this->delayedDamageFunction = nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user