Skip to content

Commit

Permalink
Merge pull request #148 from nooperation/fix_SUNITDMG_ApplyResistance…
Browse files Browse the repository at this point in the history
…sAndAbsorb_NegativeOrZeroDamage

fix SUNITDMG_ApplyResistancesAndAbsorb when dealing with negative damage values
  • Loading branch information
Lectem authored Feb 27, 2024
2 parents e5151b9 + 7476060 commit 81b5442
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 81b5442

Please sign in to comment.