Skip to content

Commit

Permalink
避免出现dummy已经被删除的情况。
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierCHN committed Jul 5, 2014
1 parent 0403bb7 commit aee045b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/vscripts/abilityhook.lua
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ function dealLastHit( caster,target )
endTime = Time()+ 0.1,
callback = function()
--print("removing dummy unit")
if dummy then dummy:Destroy() end
if IsValidEntity(dummy) then dummy:Destroy() end
if target:IsAlive() then
print("WARNING! THE UNIT IS STILL ALIVE")
end
Expand Down Expand Up @@ -496,7 +496,7 @@ local function HookUnit( target , caster ,plyid )
{
endTime = Time()+ 0.1,
callback = function()
if dummy then dummy:Destroy() end
if IsValidEntity(dummy) then dummy:Destroy() end
end
})

Expand Down Expand Up @@ -547,7 +547,7 @@ local function HookUnit( target , caster ,plyid )
{
endTime = Time()+ 0.1,
callback = function()
if dummy then dummy:Destroy() end
if IsValidEntity(dummy) then dummy:Destroy() end
end
})
end
Expand Down

0 comments on commit aee045b

Please sign in to comment.