diff options
author | ariel- <ariel-@users.noreply.github.com> | 2016-10-10 19:05:28 -0300 |
---|---|---|
committer | joschiwald <joschiwald.trinity@gmail.com> | 2017-09-05 19:19:21 +0200 |
commit | f65897f3be26fb1e208a7b5176eacd40c8418155 (patch) | |
tree | 74e5aced4a0633a75836003bde06201424e16307 /src | |
parent | b3619dd3c9d8c296556502d5415b69f1d3cf7d99 (diff) |
Core/SmartAI: There's a function for that
(cherry picked from commit e2a8cf6809bdb2fbe118d38f3cdf49bbee3078f9)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index a78036a291e..d427e9b4d36 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -239,8 +239,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u //calc random if (e.GetEventType() != SMART_EVENT_LINK && e.event.event_chance < 100 && e.event.event_chance) { - uint32 rnd = urand(1, 100); - if (e.event.event_chance <= rnd) + if (!roll_chance_i(e.event.event_chance)) return; } e.runOnce = true;//used for repeat check |