mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-25 11:50:50 +00:00
Crunchitize fixed_t precision for Lua for the vars
This commit is contained in:
parent
8d9864f2a3
commit
28c3cfa6cd
1 changed files with 16 additions and 0 deletions
|
@ -727,6 +727,14 @@ static int kartstuff_get(lua_State *L)
|
||||||
kartstufftype_t ks = luaL_checkinteger(L, 2);
|
kartstufftype_t ks = luaL_checkinteger(L, 2);
|
||||||
if (ks >= NUMKARTSTUFF)
|
if (ks >= NUMKARTSTUFF)
|
||||||
return luaL_error(L, LUA_QL("kartstufftype_t") " cannot be %u", ks);
|
return luaL_error(L, LUA_QL("kartstufftype_t") " cannot be %u", ks);
|
||||||
|
|
||||||
|
// V1 COMPATIBILITY THING
|
||||||
|
if (ks == k_lapanimation || ks == k_cardanimation || ks == k_yougotem)
|
||||||
|
{
|
||||||
|
lua_pushinteger(L, kartstuff[ks] / FRACUNIT);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
lua_pushinteger(L, kartstuff[ks]);
|
lua_pushinteger(L, kartstuff[ks]);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -743,6 +751,14 @@ static int kartstuff_set(lua_State *L)
|
||||||
return luaL_error(L, "Do not alter player_t in HUD rendering code!");
|
return luaL_error(L, "Do not alter player_t in HUD rendering code!");
|
||||||
if (hook_cmd_running)
|
if (hook_cmd_running)
|
||||||
return luaL_error(L, "Do not alter player_t in BuildCMD code!");
|
return luaL_error(L, "Do not alter player_t in BuildCMD code!");
|
||||||
|
|
||||||
|
// V1 COMPATIBILITY THING
|
||||||
|
if (ks == k_lapanimation || ks == k_cardanimation || ks == k_yougotem)
|
||||||
|
{
|
||||||
|
kartstuff[ks] = i * FRACUNIT;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
kartstuff[ks] = i;
|
kartstuff[ks] = i;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue