hedgewars/uScript.pas
changeset 10368 7ebb71a36e95
parent 10347 fd80921a8f81
child 10421 87e47843018e
equal deleted inserted replaced
10367:6e1bfa70ccb3 10368:7ebb71a36e95
  1999             begin
  1999             begin
  2000             spr:= TSprite(n);
  2000             spr:= TSprite(n);
  2001             if SpritesData[spr].Surface = nil then
  2001             if SpritesData[spr].Surface = nil then
  2002                 LuaError(call + ': ' + EnumToStr(spr) + ' cannot be placed! (required information not loaded)' )
  2002                 LuaError(call + ': ' + EnumToStr(spr) + ' cannot be placed! (required information not loaded)' )
  2003             else
  2003             else
  2004                 placed:= TryPlaceOnLand(
  2004                 placed:= ForcePlaceOnLand(
  2005                     lua_tointeger(L, 1) - SpritesData[spr].Width div 2,
  2005                     lua_tointeger(L, 1) - SpritesData[spr].Width div 2,
  2006                     lua_tointeger(L, 2) - SpritesData[spr].Height div 2,
  2006                     lua_tointeger(L, 2) - SpritesData[spr].Height div 2,
  2007                     spr, lua_tointeger(L, 4), true, lf);
  2007                     spr, lua_tointeger(L, 4), lf);
  2008             end;
  2008             end;
  2009         end;
  2009         end;
  2010 
  2010 
  2011     lua_pushboolean(L, placed);
  2011     lua_pushboolean(L, placed);
  2012     lc_placesprite:= 1
  2012     lc_placesprite:= 1