hedgewars/uScript.pas
branchspacecampaign
changeset 9646 7588daa8d28f
parent 9642 8a691e0f117a
parent 9409 6564baf7dedf
child 9648 3a3defce1b28
--- a/hedgewars/uScript.pas	Sun Sep 22 18:34:53 2013 +0300
+++ b/hedgewars/uScript.pas	Wed Sep 25 05:42:16 2013 +0300
@@ -1894,6 +1894,17 @@
         ScriptLoad(lua_tostring(L, 1));
     lc_hedgewarsscriptload:= 0;
 end;
+
+
+function lc_declareachievement(L : Plua_State) : LongInt; Cdecl;
+var gear: PGear;
+begin
+    if lua_gettop(L) <> 4 then
+        LuaError('Lua: Wrong number of parameters passed to DeclareAchievement!')
+    else
+        declareAchievement(lua_tostring(L, 1), lua_tostring(L, 2), lua_tostring(L, 3), lua_tointeger(L, 4));
+    lc_declareachievement:= 0
+end;
 ///////////////////
 
 procedure ScriptPrintStack;
@@ -2344,6 +2355,7 @@
 ScriptSetInteger('gfDisableWind', gfDisableWind);
 ScriptSetInteger('gfMoreWind', gfMoreWind);
 ScriptSetInteger('gfTagTeam', gfTagTeam);
+ScriptSetInteger('gfShoppaBorder', gfShoppaBorder);
 
 ScriptSetInteger('gmLeft', gmLeft);
 ScriptSetInteger('gmRight', gmRight);
@@ -2516,6 +2528,7 @@
 
 lua_register(luaState, _P'SetGearAIHints', @lc_setaihintsongear);
 lua_register(luaState, _P'HedgewarsScriptLoad', @lc_hedgewarsscriptload);
+lua_register(luaState, _P'DeclareAchievement', @lc_declareachievement);
 
 
 ScriptClearStack; // just to be sure stack is empty