From 7a8b48ea97ce55a5cabde8ef090116742a197c5e Mon Sep 17 00:00:00 2001
From: DarkGod <darkgod@net-core.org>
Date: Wed, 31 Dec 2014 11:44:00 +0100
Subject: [PATCH] fix break_with_step_up on sustains

---
 game/modules/tome/class/Actor.lua | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua
index c43c7ce8db..838e59f857 100644
--- a/game/modules/tome/class/Actor.lua
+++ b/game/modules/tome/class/Actor.lua
@@ -5174,6 +5174,7 @@ end
 
 -- Remove a list of effects or sustains.
 function _M:removeModifierList(list)
+	if not list then return end
 	for _, id in ipairs(list) do
 		self:removeModifier(id)
 	end
@@ -5196,15 +5197,21 @@ function _M:breakStealth()
 		-- Do not break stealth
 		if rng.percent(chance) then return end
 
+		if self._breaking_stealth then return end
+		self._breaking_stealth = true
 		self:removeModifierList(breaks)
+		self._breaking_stealth = nil
 		self.changed = true
 	end
 end
 
 --- Breaks step up if active
 function _M:breakStepUp()
+	if self._breaking_step_up then return end
+	self._breaking_step_up = true
 	local breaks = self.break_with_step_up
 	if breaks and #breaks > 0 then self:removeModifierList(breaks) end
+	self._breaking_step_up = nil
 end
 
 --- Breaks lightning speed if active
-- 
GitLab