share/hedgewars/Data/Scripts/Animate.lua
changeset 7263 644eabbc9218
parent 7255 93cf6b3b89be
child 7438 195f9cbd6df6
--- a/share/hedgewars/Data/Scripts/Animate.lua	Sat Jul 21 01:54:41 2012 +0300
+++ b/share/hedgewars/Data/Scripts/Animate.lua	Mon Jul 23 19:15:59 2012 +0300
@@ -11,7 +11,7 @@
   skipFuncList[anim] = {sfunc = func, sargs = args}
 end
 
-function RemoveSkipFunctin(anim)
+function RemoveSkipFunction(anim)
   skipFuncList[anim] = nil
 end
 
@@ -323,6 +323,18 @@
   stageEvents[seNum].evType = evType
 end
 
+function AddNewEvent(condFunc, condArgs, doFunc, doArgs, evType)
+  local i
+  for i = 1, seNum do
+    if stageEvents[i].cFunc == condFunc and stageEvents[i].cArgs == condArgs and
+       stageEvents[i].dFunc == doFunc and stageEvents[i].dArgs == doArgs and 
+       stageEvents[seNum].evType == evType then
+       return
+    end
+  end
+  AddEvent(condFunc, condArgs, doFunc, doArgs, evType)
+end
+
 function RemoveEvent(evNum)
   if stageEvents[evNum] ~= nil then
     seNum = seNum - 1