Merge branch 'push-more-lua' into awful-mix

This commit is contained in:
Latapostrophe 2020-03-11 07:37:47 +01:00
commit 43e5718851
11 changed files with 35 additions and 35 deletions

View File

@ -9931,10 +9931,10 @@ static inline int lib_getenum(lua_State *L)
lua_pushinteger(L, cv_numlaps.value);
return 1;
} else if (fastcmp(word,"racecountdown")) {
lua_pushinteger(L, countdown);
lua_pushinteger(L, racecountdown);
return 1;
} else if (fastcmp(word,"exitcountdown")) {
lua_pushinteger(L, countdown2); // This name is pretty dumb. Hence why we'll prefer more descriptive names at least in Lua...
lua_pushinteger(L, exitcountdown); // This name is pretty dumb. Hence why we'll prefer more descriptive names at least in Lua...
return 1;
}
return 0;

View File

@ -448,7 +448,7 @@ extern UINT8 maxXtraLife; // Max extra lives from rings
extern mobj_t *hunt1, *hunt2, *hunt3; // Emerald hunt locations
// For racing
extern UINT32 countdown, countdown2;
extern tic_t racecountdown, exitcountdown;
extern fixed_t gravity;
extern fixed_t mapobjectscale;

View File

@ -234,7 +234,7 @@ mobj_t *hunt1;
mobj_t *hunt2;
mobj_t *hunt3;
UINT32 countdown, countdown2; // for racing
tic_t racecountdown, exitcountdown; // for racing
fixed_t gravity;
fixed_t mapobjectscale;
@ -4592,7 +4592,7 @@ void G_InitNew(UINT8 pencoremode, const char *mapname, boolean resetplayer, bool
{
// Clear a bunch of variables
tokenlist = token = sstimer = redscore = bluescore = lastmap = 0;
countdown = countdown2 = mapreset = 0;
racecountdown = exitcountdown = mapreset = 0;
for (i = 0; i < MAXPLAYERS; i++)
{

View File

@ -8911,9 +8911,9 @@ void K_drawKartHUD(void)
if (leveltime >= starttime-(3*TICRATE)
&& leveltime < starttime+TICRATE)
K_drawKartStartCountdown();
else if (countdown && (!splitscreen || !stplyr->exiting))
else if (racecountdown && (!splitscreen || !stplyr->exiting))
{
char *countstr = va("%d", countdown/TICRATE);
char *countstr = va("%d", racecountdown/TICRATE);
if (splitscreen > 1)
V_DrawCenteredString(BASEVIDWIDTH/4, LAPS_Y+1, K_calcSplitFlags(0), countstr);

View File

@ -2645,7 +2645,7 @@ static int lib_kGetItemPatch(lua_State *L)
static int lib_kSetRaceCountdown(lua_State *L)
{
tic_t c = (tic_t)luaL_checkinteger(L, 1);
countdown = c;
racecountdown = c;
return 0;
}
@ -2654,7 +2654,7 @@ static int lib_kSetExitCountdown(lua_State *L)
{
tic_t c = (tic_t)luaL_checkinteger(L, 1);
NOHUD
countdown2 = c;
exitcountdown = c;
return 0;
}

View File

@ -2036,7 +2036,7 @@ boolean P_CheckRacers(void)
if (i == MAXPLAYERS) // finished
{
countdown = countdown2 = 0;
racecountdown = exitcountdown = 0;
return true;
}
@ -2063,13 +2063,13 @@ boolean P_CheckRacers(void)
if (j == MAXPLAYERS) // finish anyways, force a time over
{
P_DoTimeOver(&players[i]);
countdown = countdown2 = 0;
racecountdown = exitcountdown = 0;
return true;
}
}
}
if (!countdown) // Check to see if the winners have finished, to set countdown.
if (!racecountdown) // Check to see if the winners have finished, to set countdown.
{
UINT8 numingame = 0, numexiting = 0;
UINT8 winningpos = 1;
@ -2088,7 +2088,7 @@ boolean P_CheckRacers(void)
winningpos++;
if (numexiting >= winningpos)
countdown = (((netgame || multiplayer) ? cv_countdowntime.value : 30)*TICRATE) + 1; // 30 seconds to finish, get going!
racecountdown = (((netgame || multiplayer) ? cv_countdowntime.value : 30)*TICRATE) + 1; // 30 seconds to finish, get going!
}
return false;

View File

@ -3264,8 +3264,8 @@ static void P_NetArchiveMisc(void)
WRITEINT16(save_p, scrambletotal);
WRITEINT16(save_p, scramblecount);
WRITEUINT32(save_p, countdown);
WRITEUINT32(save_p, countdown2);
WRITEUINT32(save_p, racecountdown);
WRITEUINT32(save_p, exitcountdown);
WRITEFIXED(save_p, gravity);
WRITEFIXED(save_p, mapobjectscale);
@ -3373,8 +3373,8 @@ static inline boolean P_NetUnArchiveMisc(void)
scrambletotal = READINT16(save_p);
scramblecount = READINT16(save_p);
countdown = READUINT32(save_p);
countdown2 = READUINT32(save_p);
racecountdown = READUINT32(save_p);
exitcountdown = READUINT32(save_p);
gravity = READFIXED(save_p);
mapobjectscale = READFIXED(save_p);

View File

@ -2387,7 +2387,7 @@ static void P_LevelInitStuff(void)
players[i].lives = 1; // SRB2Kart
#endif
players[i].realtime = countdown = countdown2 = 0;
players[i].realtime = racecountdown = exitcountdown = 0;
curlap = bestlap = 0; // SRB2Kart
players[i].gotcontinue = false;

View File

@ -720,15 +720,15 @@ void P_Ticker(boolean run)
}
}
if (countdown > 1)
countdown--;
if (racecountdown > 1)
racecountdown--;
if (countdown2)
countdown2--;
if (exitcountdown > 1)
exitcountdown--;
if (indirectitemcooldown)
if (indirectitemcooldown > 1)
indirectitemcooldown--;
if (hyubgone)
if (hyubgone > 1)
hyubgone--;
if (G_BattleGametype())

View File

@ -1727,8 +1727,8 @@ void P_DoPlayerExit(player_t *player)
P_EndingMusic(player);
// SRB2kart 120217
//if (!countdown2)
//countdown2 = countdown + 8*TICRATE;
//if (!exitcountdown)
//exitcountdown = racecountdown + 8*TICRATE;
if (P_CheckRacers())
player->exiting = raceexittime+1;
@ -7088,7 +7088,7 @@ static void P_DeathThink(player_t *player)
}
// Keep time rolling
if (!(countdown2 && !countdown) && !(player->exiting || mapreset) && !(player->pflags & PF_TIMEOVER))
if (!(exitcountdown && !racecountdown) && !(player->exiting || mapreset) && !(player->pflags & PF_TIMEOVER))
{
if (leveltime >= starttime)
{
@ -8288,8 +8288,8 @@ void P_DoTimeOver(player_t *player)
P_EndingMusic(player);
if (!countdown2)
countdown2 = 5*TICRATE;
if (!exitcountdown)
exitcountdown = 5*TICRATE;
}
//
@ -8432,7 +8432,7 @@ void P_PlayerThink(player_t *player)
// begin the drown music for countdown!
// SRB2Kart: despite how perfect this is, it's disabled FOR A REASON
/*if (countdown == 11*TICRATE - 1)
/*if (racecountdown == 11*TICRATE - 1)
{
if (P_IsLocalPlayer(player))
S_ChangeMusicInternal("drown", false);
@ -8440,7 +8440,7 @@ void P_PlayerThink(player_t *player)
// If you've hit the countdown and you haven't made
// it to the exit, you're a goner!
else if (countdown == 1 && !player->exiting && !player->spectator && player->lives > 0)
else if (racecountdown == 1 && !player->exiting && !player->spectator && player->lives > 0)
{
P_DoTimeOver(player);
@ -8454,10 +8454,10 @@ void P_PlayerThink(player_t *player)
if (player->exiting > 1 && (player->exiting < raceexittime+2 || !G_RaceGametype())) // SRB2kart - "&& player->exiting > 1"
player->exiting--;
if (player->exiting && countdown2)
if (player->exiting && exitcountdown)
player->exiting = 99; // SRB2kart
if (player->exiting == 2 || countdown2 == 2)
if (player->exiting == 2 || exitcountdown == 2)
{
if (cv_playersforexit.value) // Count to be sure everyone's exited
{

View File

@ -1834,7 +1834,7 @@ static void ST_overlayDrawer(void)
{
patch_t *p;
if (countdown == 1)
if (racecountdown == 1)
p = timeover;
else
p = sboover;
@ -1954,7 +1954,7 @@ static void ST_overlayDrawer(void)
if (!hu_showscores && netgame && !mapreset)
{
/*if (G_GametypeUsesLives() && stplyr->lives <= 0 && countdown != 1)
/*if (G_GametypeUsesLives() && stplyr->lives <= 0 && racecountdown != 1)
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), 0, M_GetText("Press Viewpoint Key to watch a player."));
else if (gametype == GT_HIDEANDSEEK &&
(!stplyr->spectator && !(stplyr->pflags & PF_TAGIT)) && (leveltime > hidetime * TICRATE))