Skip to content

Commit

Permalink
Prevent threat from turning negative. (#2793)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gamemechanicwow authored Oct 10, 2024
1 parent c1ebb53 commit cacfd32
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/game/Threat/ThreatManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ void HostileReference::fireStatusChanged(ThreatRefStatusChangeEvent& pThreatRefS
void HostileReference::addThreat(float pMod)
{
iThreat += pMod;
if (iThreat < 0)
iThreat = 0;

// the threat is changed. Source and target unit have to be availabe
// if the link was cut before relink it again
if (!isOnline())
Expand Down

0 comments on commit cacfd32

Please sign in to comment.