diff options
author | ariel- <ariel-@users.noreply.github.com> | 2016-10-10 19:05:28 -0300 |
---|---|---|
committer | ariel- <ariel-@users.noreply.github.com> | 2016-10-10 19:05:28 -0300 |
commit | e2a8cf6809bdb2fbe118d38f3cdf49bbee3078f9 (patch) | |
tree | 589bdcc80cd7d9d32ce206064c13a59c3abf93ee /src | |
parent | f749dea8b20168a15a381931bc22812c6931fa53 (diff) |
Core/SmartAI: There's a function for that
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 127630aaf94..884a98d7ca3 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -98,8 +98,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 |