Hardcoding: Cloud player struct variables

This commit is contained in:
wolfy852 2023-12-02 16:44:07 -06:00 committed by James R
parent 9def89d4d4
commit 53c7999a14
3 changed files with 50 additions and 0 deletions

View file

@ -849,6 +849,16 @@ struct player_t
fixed_t turbineheight; // height around the turbine
boolean turbinespd; // if true, we used a sneaker and get the altpath.
// clouds (AGZ, AHZ, SSZ)
tic_t cloud; // timer while on cloud before launch
tic_t cloudlaunch; // timer set after launch for visuals
tic_t cloudbuf; // make sure we can't bounce off another cloud straight away
// tulips (AGZ)
tic_t tulip; // timer before you get launched
tic_t tuliplaunch; // timer set after launch for visuals
tic_t tulipbuf; // make sure we can't enter another tulip straight away
//
SINT8 lives;

View file

@ -552,6 +552,22 @@ static int player_get(lua_State *L)
else if (fastcmp(field,"turbinespd"))
lua_pushinteger(L, plr->turbinespd);
//clouds
else if (fastcmp(field,"cloud"))
lua_pushinteger(L, plr->cloud);
else if (fastcmp(field,"cloudlaunch"))
lua_pushinteger(L, plr->cloudlaunch);
else if (fastcmp(field,"cloudbuf"))
lua_pushinteger(L, plr->cloudbuf);
//tulips
else if (fastcmp(field,"tulip"))
lua_pushinteger(L, plr->tulip);
else if (fastcmp(field,"tuliplaunch"))
lua_pushinteger(L, plr->tuliplaunch);
else if (fastcmp(field,"tulipbuf"))
lua_pushinteger(L, plr->tulipbuf);
else if (fastcmp(field,"charflags"))
lua_pushinteger(L, plr->charflags);
else if (fastcmp(field,"followitem"))
@ -1035,6 +1051,14 @@ static int player_set(lua_State *L)
else if (fastcmp(field,"turbinespd"))
plr->turbinespd = luaL_checkinteger(L, 3);
// clouds
else if (fastcmp(field,"cloud"))
plr->cloud = luaL_checkinteger(L, 3);
else if (fastcmp(field,"cloudlaunch"))
plr->cloudlaunch = luaL_checkinteger(L, 3);
else if (fastcmp(field,"cloudbuf"))
plr->cloudbuf = luaL_checkinteger(L, 3);
//
else if (fastcmp(field,"charflags"))
plr->charflags = (UINT32)luaL_checkinteger(L, 3);

View file

@ -625,6 +625,14 @@ static void P_NetArchivePlayers(savebuffer_t *save)
WRITEFIXED(save->p, players[i].turbineheight);
WRITEUINT8(save->p, players[i].turbinespd);
WRITEUINT32(save->p, players[i].cloud);
WRITEUINT32(save->p, players[i].cloudlaunch);
WRITEUINT32(save->p, players[i].cloudbuf);
WRITEUINT32(save->p, players[i].tulip);
WRITEUINT32(save->p, players[i].tuliplaunch);
WRITEUINT32(save->p, players[i].tulipbuf);
// respawnvars_t
WRITEUINT8(save->p, players[i].respawn.state);
WRITEUINT32(save->p, K_GetWaypointHeapIndex(players[i].respawn.wp));
@ -1186,6 +1194,14 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
players[i].turbineheight = READFIXED(save->p);
players[i].turbinespd = (boolean)READUINT8(save->p);
players[i].cloud = (tic_t)READUINT32(save->p);
players[i].cloudlaunch = (tic_t)READUINT32(save->p);
players[i].cloudbuf = (tic_t)READUINT32(save->p);
players[i].tulip = (tic_t)READUINT32(save->p);
players[i].tuliplaunch = (tic_t)READUINT32(save->p);
players[i].tulipbuf = (tic_t)READUINT32(save->p);
// respawnvars_t
players[i].respawn.state = READUINT8(save->p);
players[i].respawn.wp = (waypoint_t *)(size_t)READUINT32(save->p);