hedgewars/uScript.pas
changeset 5075 59b13b38a827
parent 5074 16f9e2d1f3b2
child 5118 9cfdb9bc6140
equal deleted inserted replaced
5074:16f9e2d1f3b2 5075:59b13b38a827
   357         vg:= VisualGearByUID(lua_tointeger(L, 1));
   357         vg:= VisualGearByUID(lua_tointeger(L, 1));
   358         if vg <> nil then
   358         if vg <> nil then
   359             begin
   359             begin
   360             lua_pushinteger(L, round(vg^.X));
   360             lua_pushinteger(L, round(vg^.X));
   361             lua_pushinteger(L, round(vg^.Y));
   361             lua_pushinteger(L, round(vg^.Y));
   362             lua_pushnumber(L, vg^.dX * 1000000);
   362             lua_pushnumber(L, vg^.dX);
   363             lua_pushnumber(L, vg^.dY * 1000000);
   363             lua_pushnumber(L, vg^.dY);
   364             lua_pushnumber(L, vg^.Angle);
   364             lua_pushnumber(L, vg^.Angle);
   365             lua_pushinteger(L, vg^.Frame);
   365             lua_pushinteger(L, vg^.Frame);
   366             lua_pushinteger(L, vg^.FrameTicks);
   366             lua_pushinteger(L, vg^.FrameTicks);
   367             lua_pushinteger(L, vg^.State);
   367             lua_pushinteger(L, vg^.State);
   368             lua_pushinteger(L, vg^.Timer);
   368             lua_pushinteger(L, vg^.Timer);
   390         vg:= VisualGearByUID(lua_tointeger(L, 1));
   390         vg:= VisualGearByUID(lua_tointeger(L, 1));
   391         if vg <> nil then
   391         if vg <> nil then
   392             begin
   392             begin
   393             vg^.X:= lua_tointeger(L, 2);
   393             vg^.X:= lua_tointeger(L, 2);
   394             vg^.Y:= lua_tointeger(L, 3);
   394             vg^.Y:= lua_tointeger(L, 3);
   395             vg^.dX:= lua_tonumber(L, 4) / 1000000;  // divide by 100,000 just for consistency
   395             vg^.dX:= lua_tonumber(L, 4);
   396             vg^.dY:= lua_tonumber(L, 5) / 1000000;
   396             vg^.dY:= lua_tonumber(L, 5);
   397             vg^.Angle:= lua_tonumber(L, 6);
   397             vg^.Angle:= lua_tonumber(L, 6);
   398             vg^.Frame:= lua_tointeger(L, 7);
   398             vg^.Frame:= lua_tointeger(L, 7);
   399             if lua_tointeger(L, 8) <> 0 then vg^.FrameTicks:= lua_tointeger(L, 8);  // find a better way to do this. maybe need to break all these up.
   399             if lua_tointeger(L, 8) <> 0 then vg^.FrameTicks:= lua_tointeger(L, 8);  // find a better way to do this. maybe need to break all these up.
   400             vg^.State:= lua_tointeger(L, 9);
   400             vg^.State:= lua_tointeger(L, 9);
   401             vg^.Timer:= lua_tointeger(L, 10);
   401             vg^.Timer:= lua_tointeger(L, 10);