Skip to content

Commit

Permalink
fix: Fixes honor check crash on target killed (#1987)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamronbatman authored Oct 30, 2024
1 parent cc6d029 commit dabaa1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Projects/UOContent/Engines/Virtues/HonorContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,15 @@ public void OnTargetKilled()
Source.Mana += restore;
}

if (VirtueSystem.GetVirtues(Source).Honor > targetFame)
if (VirtueSystem.GetVirtues(Source)?.Honor > targetFame)
{
return;
}

// Initial honor gain is 100th of the monsters honor
var dGain = targetFame / 100.0 * (_honorDamage / _totalDamage);

if (_honorDamage == _totalDamage && _firstHit == FirstHit.Granted)
if (Math.Abs(_honorDamage - _totalDamage) < 0.01 && _firstHit == FirstHit.Granted)
{
dGain *= 1.5; // honor gain is increased a lot more if the combat was fully honorable
}
Expand Down

0 comments on commit dabaa1e

Please sign in to comment.