Skip to content

Commit

Permalink
SUNITDMG_ApplyResistancesAndAbsorb does not take into account resista…
Browse files Browse the repository at this point in the history
…nces/absorptions/damage reduction if damage is <= 0. It just forces damage to be 0 and returns. This matters for weird cases where you have 0 damage and some additional absorbs/etc, pushing pValue negative when the original logic would not have done that
  • Loading branch information
nooperation committed Feb 26, 2024
1 parent d0e62df commit 7476060
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/D2Game/src/UNIT/SUnitDmg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,11 @@ void __fastcall SUNITDMG_ApplyResistancesAndAbsorb(D2DamageInfoStrc* pDamageInfo
int32_t nValue = *pValue;
int32_t nPreviousValue = *pValue;

*pValue = std::max(*pValue, 0);
if (*pValue <= 0)
{
*pValue = 0;
return;
}

int32_t nResValue = 0;
if (pDamageStatTableRecord->nResStatId != -1)
Expand Down

0 comments on commit 7476060

Please sign in to comment.