aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKelno <dr.kelno@gmail.com>2015-05-20 16:16:11 +0200
committerKelno <dr.kelno@gmail.com>2015-05-20 16:16:11 +0200
commitc142282e34673f0d33979c2e0a4ba4184e36898c (patch)
treea0de4235cb75ed00ae540302dba77eb23b474fd6 /src
parent9e985f81b43dbdaa0d274284db58e6f86743adb5 (diff)
Removed useless calculation in last commit
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h
index c38cca8d98f..51628eded54 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.h
+++ b/src/server/game/AI/SmartScripts/SmartScript.h
@@ -247,7 +247,14 @@ class SmartScript
DecPhase(abs(p));
}
- void DecPhase(int32 p = 1) { mEventPhase -= (mEventPhase < (uint32)p ? (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; }