diff options
author | maximius <none@none> | 2009-09-26 02:09:26 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-09-26 02:09:26 -0700 |
commit | f8a6434fc0c2ea7cfd325830bac6a208e171f0ab (patch) | |
tree | cb5feaedb834a02cb328525971f59140edb28c3b /src/game/CreatureEventAI.cpp | |
parent | 2853aa1cd1bb3026d697672aefb6eace902f90b1 (diff) |
*Replace a ton of switches with RAND(), and overload RAND() to support up to 16 parameters.
*Add a safety check to prevent knocking players off of transports, just in case they die while on one.
*Fix a couple incorrect spell defines.
--HG--
branch : trunk
Diffstat (limited to 'src/game/CreatureEventAI.cpp')
-rw-r--r-- | src/game/CreatureEventAI.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp index bf606c6c488..cb6cc3e7869 100644 --- a/src/game/CreatureEventAI.cpp +++ b/src/game/CreatureEventAI.cpp @@ -354,14 +354,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 int32 temp = 0; if (action.text.TextId2 && action.text.TextId3) - { - switch( rand()%3 ) - { - case 0: temp = action.text.TextId1; break; - case 1: temp = action.text.TextId2; break; - case 2: temp = action.text.TextId3; break; - } - } + temp = RAND(action.text.TextId1,action.text.TextId2,action.text.TextId3); else if (action.text.TextId2 && urand(0,1)) temp = action.text.TextId2; else |