Core/Scripts: Limited possible phase number for EventMap to prevent overflows

This commit is contained in:
Shauren
2011-10-05 16:43:43 +02:00
parent 5db7bf9cc3
commit 8a3ced48c1
+2 -2
View File
@@ -329,7 +329,7 @@ class EventMap : private std::map<uint32, uint32>
// Sets event phase, must be in range 1 - 8 // Sets event phase, must be in range 1 - 8
void SetPhase(uint32 phase) void SetPhase(uint32 phase)
{ {
if (phase && phase < 9) if (phase && phase < 8)
_phase = (1 << (phase + 24)); _phase = (1 << (phase + 24));
} }
@@ -340,7 +340,7 @@ class EventMap : private std::map<uint32, uint32>
time += _time; time += _time;
if (groupId && groupId < 9) if (groupId && groupId < 9)
eventId |= (1 << (groupId + 16)); eventId |= (1 << (groupId + 16));
if (phase && phase < 9) if (phase && phase < 8)
eventId |= (1 << (phase + 24)); eventId |= (1 << (phase + 24));
const_iterator itr = find(time); const_iterator itr = find(time);
while (itr != end()) while (itr != end())