hedgewars/uScript.pas
changeset 6779 ccd8aecaff6d
parent 6764 e56ff0231540
child 6780 166ee5275915
equal deleted inserted replaced
6778:a9c6457dca29 6779:ccd8aecaff6d
  1395     else
  1395     else
  1396         begin
  1396         begin
  1397         gear:= GearByUID(lua_tointeger(L, 1));
  1397         gear:= GearByUID(lua_tointeger(L, 1));
  1398         if gear <> nil then
  1398         if gear <> nil then
  1399             begin
  1399             begin
  1400             lua_pushinteger(L, hwRound(gear^.dX * 1000000));
  1400             // gear dX determines hog orientation
       
  1401             if (gear^.dX.isNegative) and (gear^.dX = _0) then lua_pushinteger(L, -1)
       
  1402             else lua_pushinteger(L, hwRound(gear^.dX * 1000000));
  1401             lua_pushinteger(L, hwRound(gear^.dY * 1000000))
  1403             lua_pushinteger(L, hwRound(gear^.dY * 1000000))
  1402             end
  1404             end
  1403         end;
  1405         end;
  1404     lc_getgearvelocity:= 2;
  1406     lc_getgearvelocity:= 2;
  1405 end;
  1407 end;