hedgewars/uScript.pas
changeset 2795 c9c830897547
parent 2794 befd3808c63a
child 2798 d48bbe4518e6
equal deleted inserted replaced
2794:befd3808c63a 2795:c9c830897547
   183 end;
   183 end;
   184 
   184 
   185 function lc_addteam(L : Plua_State) : LongInt; Cdecl;
   185 function lc_addteam(L : Plua_State) : LongInt; Cdecl;
   186 begin
   186 begin
   187 	if lua_gettop(L) <> 5 then
   187 	if lua_gettop(L) <> 5 then
   188 		WriteLnToConsole('LUA: Wrong number of parameters passed to AddTeam!')
   188 		begin
       
   189 		WriteLnToConsole('LUA: Wrong number of parameters passed to AddTeam!');
       
   190 		//lua_pushnil(L)
       
   191 		end
   189 	else
   192 	else
   190 		begin
   193 		begin
   191 		ParseCommand('addteam ' + lua_tostring(L, 2) + ' ' + lua_tostring(L, 1), true);
   194 		ParseCommand('addteam ' + lua_tostring(L, 2) + ' ' + lua_tostring(L, 1), true);
   192 		ParseCommand('grave ' + lua_tostring(L, 3), true);
   195 		ParseCommand('grave ' + lua_tostring(L, 3), true);
   193 		ParseCommand('fort ' + lua_tostring(L, 4), true);
   196 		ParseCommand('fort ' + lua_tostring(L, 4), true);
   194 		ParseCommand('voicepack ' + lua_tostring(L, 5), true);
   197 		ParseCommand('voicepack ' + lua_tostring(L, 5), true);
   195 		CurrentTeam^.Binds:= DefaultBinds;
   198 		CurrentTeam^.Binds:= DefaultBinds;
   196 		lua_pushinteger(L, LongInt(CurrentTeam));
   199 		// fails on x64
   197 		end;
   200 		//lua_pushinteger(L, LongInt(CurrentTeam));
   198 	lc_addteam:= 1;
   201 		end;
       
   202 	lc_addteam:= 0;//1;
   199 end;
   203 end;
   200 
   204 
   201 function lc_addhog(L : Plua_State) : LongInt; Cdecl;
   205 function lc_addhog(L : Plua_State) : LongInt; Cdecl;
   202 begin
   206 begin
   203 	if lua_gettop(L) <> 4 then
   207 	if lua_gettop(L) <> 4 then