From e2a8cf6809bdb2fbe118d38f3cdf49bbee3078f9 Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 10 Oct 2016 19:05:28 -0300 Subject: Core/SmartAI: There's a function for that --- src/server/game/AI/SmartScripts/SmartScript.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') 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 -- cgit v1.2.3