From 2f25a16eabe29c6809ca4fd55eb38f644a2c0de1 Mon Sep 17 00:00:00 2001 From: Soo Kuo-Yi Date: Sat, 20 May 2017 16:57:36 +0800 Subject: [PATCH] Fix Bubble Orb destroy timer logic (#787) Closes: #785 --- game/scripts/vscripts/items/reflex/preemptive_bubble.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/game/scripts/vscripts/items/reflex/preemptive_bubble.lua b/game/scripts/vscripts/items/reflex/preemptive_bubble.lua index 80eb8bba79..3078392387 100644 --- a/game/scripts/vscripts/items/reflex/preemptive_bubble.lua +++ b/game/scripts/vscripts/items/reflex/preemptive_bubble.lua @@ -71,7 +71,7 @@ function modifier_item_preemptive_bubble_aura_block:OnCreated(keys) self.bubbleCenter = self:GetParent():GetOrigin() self.caster = self:GetCaster() self.casterTeam = self.caster:GetTeamNumber() - self.bubbleIdentifier = "BubbleOrbID: " .. self.casterTeam .. "," .. self.bubbleCenter.x .. "," .. self.bubbleCenter.y + self.bubbleID = "BubbleOrbID: " .. self.casterTeam .. "," .. self.bubbleCenter.x .. "," .. self.bubbleCenter.y self.ability = self:GetAbility() self.radius = self.ability:GetSpecialValueFor("radius") self.aura_stickiness = self.ability:GetSpecialValueFor("aura_stickiness") @@ -103,10 +103,11 @@ function modifier_item_preemptive_bubble_aura_block:OnIntervalThink() end local duplicateModifier = nth(1, filter(IsFromThisBubble, bubbleModifiers)) + local bubbleModifierID = self.bubbleID .. "," .. unit:entindex() -- If the unit already has a modifier with the same center then refresh its timer if duplicateModifier then - Timers:RemoveTimer(self.bubbleIdentifier) - Timers:CreateTimer(self.bubbleIdentifier, { + Timers:RemoveTimer(bubbleModifierID) + Timers:CreateTimer(bubbleModifierID, { endTime = self.aura_stickiness, callback = function() duplicateModifier:Destroy() @@ -117,7 +118,7 @@ function modifier_item_preemptive_bubble_aura_block:OnIntervalThink() aura_origin_x = self.bubbleCenter.x, aura_origin_y = self.bubbleCenter.y }) - Timers:CreateTimer(self.bubbleIdentifier, { + Timers:CreateTimer(bubbleModifierID, { endTime = self.aura_stickiness, callback = function() newBubbleModifier:Destroy()