hedgewars/uScript.pas
changeset 9397 7b7ee65f82ad
parent 9387 6478ed9ead25
child 9409 6564baf7dedf
equal deleted inserted replaced
9395:2659192d5af9 9397:7b7ee65f82ad
  1891         lua_pushnil(L)
  1891         lua_pushnil(L)
  1892         end
  1892         end
  1893     else
  1893     else
  1894         ScriptLoad(lua_tostring(L, 1));
  1894         ScriptLoad(lua_tostring(L, 1));
  1895     lc_hedgewarsscriptload:= 0;
  1895     lc_hedgewarsscriptload:= 0;
       
  1896 end;
       
  1897 
       
  1898 
       
  1899 function lc_declareachievement(L : Plua_State) : LongInt; Cdecl;
       
  1900 var gear: PGear;
       
  1901 begin
       
  1902     if lua_gettop(L) <> 3 then
       
  1903         LuaError('Lua: Wrong number of parameters passed to DeclareAchievement!')
       
  1904     else
       
  1905         declareAchievement(lua_tostring(L, 1), lua_tostring(L, 2), lua_tointeger(L, 3));
       
  1906     lc_declareachievement:= 0
  1896 end;
  1907 end;
  1897 ///////////////////
  1908 ///////////////////
  1898 
  1909 
  1899 procedure ScriptPrintStack;
  1910 procedure ScriptPrintStack;
  1900 var n, i : LongInt;
  1911 var n, i : LongInt;
  2511 lua_register(luaState, _P'GetCurAmmoType', @lc_getcurammotype);
  2522 lua_register(luaState, _P'GetCurAmmoType', @lc_getcurammotype);
  2512 lua_register(luaState, _P'TestRectForObstacle', @lc_testrectforobstacle);
  2523 lua_register(luaState, _P'TestRectForObstacle', @lc_testrectforobstacle);
  2513 
  2524 
  2514 lua_register(luaState, _P'SetGearAIHints', @lc_setaihintsongear);
  2525 lua_register(luaState, _P'SetGearAIHints', @lc_setaihintsongear);
  2515 lua_register(luaState, _P'HedgewarsScriptLoad', @lc_hedgewarsscriptload);
  2526 lua_register(luaState, _P'HedgewarsScriptLoad', @lc_hedgewarsscriptload);
       
  2527 lua_register(luaState, _P'DeclareAchievement', @lc_declareachievement);
  2516 
  2528 
  2517 
  2529 
  2518 ScriptClearStack; // just to be sure stack is empty
  2530 ScriptClearStack; // just to be sure stack is empty
  2519 ScriptLoaded:= false;
  2531 ScriptLoaded:= false;
  2520 end;
  2532 end;