added SetAmmoStore to lua for convinience
authorHenek
Mon, 12 Dec 2011 19:23:05 +0100
changeset 6529 40f9ef7d824d
parent 6528 fb2918089225
child 6530 dc6ce7eb556b
added SetAmmoStore to lua for convinience
hedgewars/uScript.pas
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/FrontendDataUtils.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/GameMode.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Grave.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Map.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Scheme.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Team.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Weapon.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/UserInput/TouchInterface.java
share/hedgewars/Data/Scripts/plist/Racer.plist
--- a/hedgewars/uScript.pas	Mon Dec 12 00:10:55 2011 +0100
+++ b/hedgewars/uScript.pas	Mon Dec 12 19:23:05 2011 +0100
@@ -1401,6 +1401,22 @@
     lc_setammo:= 0
 end;
 
+function lc_setammostore(L : Plua_State) : LongInt; Cdecl;
+var np: LongInt;
+begin
+    np:= lua_gettop(L);
+    if (np <> 4) then
+        LuaError('Lua: Wrong number of parameters passed to SetAmmoStore!')
+    else
+        begin
+        ScriptAmmoLoadout:= lua_tostring(L, 1);
+        ScriptAmmoProbability:= lua_tostring(L, 2);
+        ScriptAmmoDelay:= lua_tostring(L, 3);
+        ScriptAmmoReinforcement:= lua_tostring(L, 4);
+        end;
+    lc_setammostore:= 0
+end;
+
 function lc_getrandom(L : Plua_State) : LongInt; Cdecl;
 var m : LongInt;
 begin
@@ -2028,6 +2044,7 @@
 lua_register(luaState, 'HideMission', @lc_hidemission);
 lua_register(luaState, 'AddCaption', @lc_addcaption);
 lua_register(luaState, 'SetAmmo', @lc_setammo);
+lua_register(luaState, 'SetAmmoStore', @lc_setammostore);
 lua_register(luaState, 'PlaySound', @lc_playsound);
 lua_register(luaState, 'AddTeam', @lc_addteam);
 lua_register(luaState, 'AddHog', @lc_addhog);