hedgewars/uScript.pas
branch0.9.19
changeset 9135 151c8e553de2
parent 9080 9b42757d7e71
child 9138 9e94a9bc8c7e
--- a/hedgewars/uScript.pas	Tue Jun 11 11:48:36 2013 +0200
+++ b/hedgewars/uScript.pas	Tue Aug 06 00:26:07 2013 +0400
@@ -1835,6 +1835,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) <> 3 then
+        LuaError('Lua: Wrong number of parameters passed to DeclareAchievement!')
+    else
+        declareAchievement(lua_tostring(L, 1), lua_tostring(L, 2), lua_tointeger(L, 3));
+    lc_declareachievement:= 0
+end;
 ///////////////////
 
 procedure ScriptPrintStack;
@@ -2451,6 +2462,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