hedgewars/uScript.pas
changeset 5612 2638dec1b323
parent 5583 63b274a4fb01
child 5638 e35ba2a400d8
child 5644 4ad07103cfae
equal deleted inserted replaced
5610:f8bdc789ac60 5612:2638dec1b323
  1227     else
  1227     else
  1228         begin
  1228         begin
  1229         gear:= GearByUID(lua_tointeger(L, 1));
  1229         gear:= GearByUID(lua_tointeger(L, 1));
  1230         if gear <> nil then
  1230         if gear <> nil then
  1231             begin
  1231             begin
  1232             lua_pushinteger(L, gear^.TargetX);
  1232             lua_pushinteger(L, gear^.Target.X);
  1233             lua_pushinteger(L, gear^.TargetY)
  1233             lua_pushinteger(L, gear^.Target.Y)
       
  1234             end
       
  1235         else
       
  1236             begin
       
  1237             lua_pushnil(L);
       
  1238             lua_pushnil(L)
  1234             end
  1239             end
  1235         end;
  1240         end;
  1236     lc_getgeartarget:= 2;
  1241     lc_getgeartarget:= 2;
  1237 end;
  1242 end;
  1238 
  1243 
  1244     else
  1249     else
  1245         begin
  1250         begin
  1246         gear:= GearByUID(lua_tointeger(L, 1));
  1251         gear:= GearByUID(lua_tointeger(L, 1));
  1247         if gear <> nil then
  1252         if gear <> nil then
  1248             begin
  1253             begin
  1249             gear^.TargetX:= lua_tointeger(L, 2);
  1254             gear^.Target.X:= lua_tointeger(L, 2);
  1250             gear^.TargetY:= lua_tointeger(L, 3)
  1255             gear^.Target.Y:= lua_tointeger(L, 3)
  1251             end
  1256             end
  1252         end;
  1257         end;
  1253     lc_setgeartarget:= 0
  1258     lc_setgeartarget:= 0
  1254 end;
  1259 end;
  1255 
  1260