share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/dragon.lua
changeset 12548 933aee9786c3
parent 12511 15e9ef8be44f
child 12555 d51ea6ac1ca1
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/dragon.lua	Wed Sep 27 02:57:44 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/dragon.lua	Wed Sep 27 03:54:35 2017 +0200
@@ -414,6 +414,14 @@
   AddFunction({func = AfterKillAnim, args = {}})
 end
 
+function CheckPutCrates(gear)
+  if gear and GetHealth(gear) then
+    return StoppedGear(gear)
+  else
+    return false
+  end
+end
+
 function PutCrates(index)
   if index <= 7 then
     cratesNum = cratesNum + 1
@@ -421,7 +429,7 @@
     AddNewEvent(CheckGearDead, {crates[cratesNum]}, PutCrates, {index + 1}, 0)
     FollowGear(native)
   else
-    AddEvent(StoppedGear, {native}, DoCratesTaken, {}, 0)
+    AddEvent(CheckPutCrates, {native}, DoCratesTaken, {}, 0)
   end
   if index == 4 then
     AnimSay(native, loc("I'm a ninja."), SAY_THINK, 0)