mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Add player.oldcmd -- ticcmd from previous tic
This commit is contained in:
parent
c792818887
commit
7251ed5d9e
3 changed files with 10 additions and 0 deletions
|
|
@ -333,6 +333,7 @@ typedef struct player_s
|
|||
|
||||
// Caveat: ticcmd_t is ATTRPACK! Be careful what precedes it.
|
||||
ticcmd_t cmd;
|
||||
ticcmd_t oldcmd; // from the previous tic
|
||||
|
||||
playerstate_t playerstate;
|
||||
|
||||
|
|
|
|||
|
|
@ -192,6 +192,8 @@ static int player_get(lua_State *L)
|
|||
LUA_PushUserdata(L, plr->mo, META_MOBJ);
|
||||
else if (fastcmp(field,"cmd"))
|
||||
LUA_PushUserdata(L, &plr->cmd, META_TICCMD);
|
||||
else if (fastcmp(field,"oldcmd"))
|
||||
LUA_PushUserdata(L, &plr->oldcmd, META_TICCMD);
|
||||
else if (fastcmp(field,"respawn"))
|
||||
LUA_PushUserdata(L, &plr->respawn, META_RESPAWN);
|
||||
else if (fastcmp(field,"playerstate"))
|
||||
|
|
@ -526,6 +528,8 @@ static int player_set(lua_State *L)
|
|||
}
|
||||
else if (fastcmp(field,"cmd"))
|
||||
return NOSET;
|
||||
else if (fastcmp(field,"oldcmd"))
|
||||
return NOSET;
|
||||
else if (fastcmp(field,"respawn"))
|
||||
return NOSET;
|
||||
else if (fastcmp(field,"playerstate"))
|
||||
|
|
|
|||
|
|
@ -768,6 +768,11 @@ void P_Ticker(boolean run)
|
|||
K_TimerInit();
|
||||
}
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
G_CopyTiccmd(&players[i].oldcmd, &players[i].cmd, 1);
|
||||
}
|
||||
|
||||
// Z_CheckMemCleanup();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue