mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 19:06:49 +01:00
Merge pull request #14728 from kelno/fixes
Core/SAI: Fixed a math error overflow in SmartScript::DecPhase(int32)
(cherry picked from commit 6d7339e7a3)
This commit is contained in:
@@ -246,7 +246,14 @@ class SmartScript
|
||||
DecPhase(abs(p));
|
||||
}
|
||||
|
||||
void DecPhase(int32 p = 1) { mEventPhase -= (mEventPhase < (uint32)p ? (uint32)p - mEventPhase : (uint32)p); }
|
||||
void DecPhase(int32 p = 1)
|
||||
{
|
||||
if(mEventPhase > (uint32)p)
|
||||
mEventPhase -= (uint32)p;
|
||||
else
|
||||
mEventPhase = 0;
|
||||
}
|
||||
|
||||
bool IsInPhase(uint32 p) const { return ((1 << (mEventPhase - 1)) & p) != 0; }
|
||||
void SetPhase(uint32 p = 0) { mEventPhase = p; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user