share/hedgewars/Data/Scripts/Animate.lua
changeset 7255 93cf6b3b89be
parent 7245 53f73f4ae203
child 7263 644eabbc9218
--- a/share/hedgewars/Data/Scripts/Animate.lua	Mon Jul 16 20:38:31 2012 +0300
+++ b/share/hedgewars/Data/Scripts/Animate.lua	Mon Jul 16 20:56:55 2012 +0300
@@ -72,9 +72,10 @@
 end
 
 function AnimSwitchHog(gear)
+  --SetGearMessage(gear, 0)
+  --SetState(gear, 0)
   SwitchHog(gear)
   FollowGear(gear)
-  SetGearMessage(gear, 0)
   return true
 end
 
@@ -213,8 +214,11 @@
   return true
 end
 
-function AnimVisualGear(gear, x, y, vgType, state, critical)
-  AddVisualGear(x, y, vgType, state, critical)
+function AnimVisualGear(gear, x, y, vgType, state, critical, follow)
+  local vgear = AddVisualGear(x, y, vgType, state, critical)
+  if follow == true then 
+    FollowGear(vgear)
+  end
   return true
 end