mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-08 09:12:24 +00:00
Merge remote-tracking branch 'origin/next' into server-bots
This commit is contained in:
commit
8ed18a12a4
12 changed files with 71 additions and 59 deletions
|
@ -29,11 +29,16 @@ void B_UpdateBotleader(player_t *player)
|
||||||
{
|
{
|
||||||
if (players[i].bot || players[i].playerstate != PST_LIVE || players[i].spectator || !players[i].mo)
|
if (players[i].bot || players[i].playerstate != PST_LIVE || players[i].spectator || !players[i].mo)
|
||||||
continue;
|
continue;
|
||||||
if (!player->mo) //Can't do distance calculations if there's no player object, so we'll just take the first we find
|
|
||||||
|
if (!player->botleader)
|
||||||
{
|
{
|
||||||
player->botleader = &players[i];
|
player->botleader = &players[i]; // set default
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!player->mo)
|
||||||
|
return;
|
||||||
|
|
||||||
//Update best candidate based on nearest distance
|
//Update best candidate based on nearest distance
|
||||||
dist = R_PointToDist2(player->mo->x, player->mo->y, players[i].mo->x, players[i].mo->y);
|
dist = R_PointToDist2(player->mo->x, player->mo->y, players[i].mo->x, players[i].mo->y);
|
||||||
if (neardist > dist)
|
if (neardist > dist)
|
||||||
|
|
|
@ -3763,7 +3763,7 @@ static void Command_ListWADS_f(void)
|
||||||
nameonly(tempname = va("%s", wadfiles[i]->filename));
|
nameonly(tempname = va("%s", wadfiles[i]->filename));
|
||||||
if (!i)
|
if (!i)
|
||||||
CONS_Printf("\x82 IWAD\x80: %s\n", tempname);
|
CONS_Printf("\x82 IWAD\x80: %s\n", tempname);
|
||||||
else if (i <= mainwads)
|
else if (i < mainwads)
|
||||||
CONS_Printf("\x82 * %.2d\x80: %s\n", i, tempname);
|
CONS_Printf("\x82 * %.2d\x80: %s\n", i, tempname);
|
||||||
else if (!wadfiles[i]->important)
|
else if (!wadfiles[i]->important)
|
||||||
CONS_Printf("\x86 %.2d: %s\n", i, tempname);
|
CONS_Printf("\x86 %.2d: %s\n", i, tempname);
|
||||||
|
|
|
@ -5088,6 +5088,7 @@ struct int_const_s const INT_CONST[] = {
|
||||||
{"PAL_MIXUP",PAL_MIXUP},
|
{"PAL_MIXUP",PAL_MIXUP},
|
||||||
{"PAL_RECYCLE",PAL_RECYCLE},
|
{"PAL_RECYCLE",PAL_RECYCLE},
|
||||||
{"PAL_NUKE",PAL_NUKE},
|
{"PAL_NUKE",PAL_NUKE},
|
||||||
|
{"PAL_INVERT",PAL_INVERT},
|
||||||
// for P_DamageMobj
|
// for P_DamageMobj
|
||||||
//// Damage types
|
//// Damage types
|
||||||
{"DMG_WATER",DMG_WATER},
|
{"DMG_WATER",DMG_WATER},
|
||||||
|
|
|
@ -3275,7 +3275,7 @@ boolean G_EnoughPlayersFinished(void)
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
if (!playeringame[i] || players[i].spectator || players[i].bot == BOT_2PAI || players[i].bot == BOT_2PHUMAN)
|
if (!playeringame[i] || players[i].spectator || players[i].bot)
|
||||||
continue;
|
continue;
|
||||||
if (players[i].quittime > 30 * TICRATE)
|
if (players[i].quittime > 30 * TICRATE)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -2472,7 +2472,7 @@ static void HU_Draw32TeamTabRankings(playersort_t *tab, INT32 whiteplayer)
|
||||||
if (!players[tab[i].num].quittime || (leveltime / (TICRATE/2) & 1))
|
if (!players[tab[i].num].quittime || (leveltime / (TICRATE/2) & 1))
|
||||||
V_DrawString(x + 10, y,
|
V_DrawString(x + 10, y,
|
||||||
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
|
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
|
||||||
| (greycheck ? 0 : V_TRANSLUCENT)
|
| (greycheck ? V_TRANSLUCENT : 0)
|
||||||
| V_ALLOWLOWERCASE, name);
|
| V_ALLOWLOWERCASE, name);
|
||||||
|
|
||||||
if (gametyperules & GTR_TEAMFLAGS)
|
if (gametyperules & GTR_TEAMFLAGS)
|
||||||
|
@ -2733,12 +2733,12 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
|
||||||
if (circuitmap)
|
if (circuitmap)
|
||||||
{
|
{
|
||||||
if (players[tab[i].num].exiting)
|
if (players[tab[i].num].exiting)
|
||||||
V_DrawRightAlignedThinString(x+146, y, 0, va("%i:%02i.%02i", G_TicsToMinutes(players[tab[i].num].realtime,true), G_TicsToSeconds(players[tab[i].num].realtime), G_TicsToCentiseconds(players[tab[i].num].realtime)));
|
V_DrawRightAlignedThinString(x+100, y, 0, va("%i:%02i.%02i", G_TicsToMinutes(players[tab[i].num].realtime,true), G_TicsToSeconds(players[tab[i].num].realtime), G_TicsToCentiseconds(players[tab[i].num].realtime)));
|
||||||
else
|
else
|
||||||
V_DrawRightAlignedThinString(x+146, y, (greycheck ? V_TRANSLUCENT : 0), va("%u", tab[i].count));
|
V_DrawRightAlignedThinString(x+100, y, (greycheck ? V_TRANSLUCENT : 0), va("%u", tab[i].count));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
V_DrawRightAlignedThinString(x+146, y, (greycheck ? V_TRANSLUCENT : 0), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count)));
|
V_DrawRightAlignedThinString(x+100, y, (greycheck ? V_TRANSLUCENT : 0), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
V_DrawRightAlignedThinString(x+100, y, (greycheck ? V_TRANSLUCENT : 0), va("%u", tab[i].count));
|
V_DrawRightAlignedThinString(x+100, y, (greycheck ? V_TRANSLUCENT : 0), va("%u", tab[i].count));
|
||||||
|
@ -2786,7 +2786,7 @@ static void HU_Draw32TabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scor
|
||||||
if (!players[tab[i].num].quittime || (leveltime / (TICRATE/2) & 1))
|
if (!players[tab[i].num].quittime || (leveltime / (TICRATE/2) & 1))
|
||||||
V_DrawString(x + 10, y,
|
V_DrawString(x + 10, y,
|
||||||
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
|
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
|
||||||
| (greycheck ? 0 : V_TRANSLUCENT)
|
| (greycheck ? V_TRANSLUCENT : 0)
|
||||||
| V_ALLOWLOWERCASE, name);
|
| V_ALLOWLOWERCASE, name);
|
||||||
|
|
||||||
if (G_GametypeUsesLives()) //show lives
|
if (G_GametypeUsesLives()) //show lives
|
||||||
|
@ -2846,13 +2846,13 @@ static void HU_Draw32TabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scor
|
||||||
if (players[tab[i].num].exiting)
|
if (players[tab[i].num].exiting)
|
||||||
V_DrawRightAlignedThinString(x+128, y, 0, va("%i:%02i.%02i", G_TicsToMinutes(players[tab[i].num].realtime,true), G_TicsToSeconds(players[tab[i].num].realtime), G_TicsToCentiseconds(players[tab[i].num].realtime)));
|
V_DrawRightAlignedThinString(x+128, y, 0, va("%i:%02i.%02i", G_TicsToMinutes(players[tab[i].num].realtime,true), G_TicsToSeconds(players[tab[i].num].realtime), G_TicsToCentiseconds(players[tab[i].num].realtime)));
|
||||||
else
|
else
|
||||||
V_DrawRightAlignedThinString(x+128, y, (greycheck ? 0 : V_TRANSLUCENT), va("%u", tab[i].count));
|
V_DrawRightAlignedThinString(x+128, y, (greycheck ? V_TRANSLUCENT : 0), va("%u", tab[i].count));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
V_DrawRightAlignedThinString(x+128, y, (greycheck ? 0 : V_TRANSLUCENT), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count)));
|
V_DrawRightAlignedThinString(x+128, y, (greycheck ? V_TRANSLUCENT : 0), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
V_DrawRightAlignedThinString(x+128, y, (greycheck ? 0 : V_TRANSLUCENT), va("%u", tab[i].count));
|
V_DrawRightAlignedThinString(x+128, y, (greycheck ? V_TRANSLUCENT : 0), va("%u", tab[i].count));
|
||||||
|
|
||||||
y += 9;
|
y += 9;
|
||||||
if (i == 16)
|
if (i == 16)
|
||||||
|
@ -3091,7 +3091,7 @@ static void HU_DrawRankings(void)
|
||||||
HU_DrawTeamTabRankings(tab, whiteplayer);
|
HU_DrawTeamTabRankings(tab, whiteplayer);
|
||||||
else if (scorelines <= 9 && !cv_compactscoreboard.value)
|
else if (scorelines <= 9 && !cv_compactscoreboard.value)
|
||||||
HU_DrawTabRankings(40, 32, tab, scorelines, whiteplayer);
|
HU_DrawTabRankings(40, 32, tab, scorelines, whiteplayer);
|
||||||
else if (scorelines <= 20 && !cv_compactscoreboard.value)
|
else if (scorelines <= 18 && !cv_compactscoreboard.value)
|
||||||
HU_DrawDualTabRankings(32, 32, tab, scorelines, whiteplayer);
|
HU_DrawDualTabRankings(32, 32, tab, scorelines, whiteplayer);
|
||||||
else
|
else
|
||||||
HU_Draw32TabRankings(14, 28, tab, scorelines, whiteplayer);
|
HU_Draw32TabRankings(14, 28, tab, scorelines, whiteplayer);
|
||||||
|
|
|
@ -11588,9 +11588,7 @@ static void M_ServerOptions(INT32 choice)
|
||||||
OP_ServerOptionsMenu[ 2].status = IT_STRING | IT_CVAR;
|
OP_ServerOptionsMenu[ 2].status = IT_STRING | IT_CVAR;
|
||||||
OP_ServerOptionsMenu[ 3].status = IT_STRING | IT_CVAR;
|
OP_ServerOptionsMenu[ 3].status = IT_STRING | IT_CVAR;
|
||||||
OP_ServerOptionsMenu[ 4].status = IT_STRING | IT_CVAR;
|
OP_ServerOptionsMenu[ 4].status = IT_STRING | IT_CVAR;
|
||||||
OP_ServerOptionsMenu[36].status = (netgame
|
OP_ServerOptionsMenu[36].status = IT_STRING | IT_CVAR | IT_CV_STRING;
|
||||||
? IT_GRAYEDOUT
|
|
||||||
: (IT_STRING | IT_CVAR | IT_CV_STRING));
|
|
||||||
OP_ServerOptionsMenu[37].status = IT_STRING | IT_CVAR;
|
OP_ServerOptionsMenu[37].status = IT_STRING | IT_CVAR;
|
||||||
OP_ServerOptionsMenu[38].status = IT_STRING | IT_CVAR;
|
OP_ServerOptionsMenu[38].status = IT_STRING | IT_CVAR;
|
||||||
}
|
}
|
||||||
|
|
|
@ -349,6 +349,7 @@ void P_FlashPal(player_t *pl, UINT16 type, UINT16 duration);
|
||||||
#define PAL_MIXUP 2
|
#define PAL_MIXUP 2
|
||||||
#define PAL_RECYCLE 3
|
#define PAL_RECYCLE 3
|
||||||
#define PAL_NUKE 4
|
#define PAL_NUKE 4
|
||||||
|
#define PAL_INVERT 5
|
||||||
|
|
||||||
//
|
//
|
||||||
// P_ENEMY
|
// P_ENEMY
|
||||||
|
|
|
@ -2522,7 +2522,7 @@ boolean P_ZMovement(mobj_t *mo)
|
||||||
{
|
{
|
||||||
P_KillMobj(mo, NULL, NULL, 0);
|
P_KillMobj(mo, NULL, NULL, 0);
|
||||||
}
|
}
|
||||||
return false;
|
return !P_MobjWasRemoved(mo); // allows explosion states to run
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -3046,17 +3046,29 @@ static void P_AddBinaryMapTags(void)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < numlines; i++)
|
for (i = 0; i < numlines; i++) {
|
||||||
{
|
|
||||||
// 96: Apply Tag to Tagged Sectors
|
|
||||||
// 97: Apply Tag to Front Sector
|
// 97: Apply Tag to Front Sector
|
||||||
// 98: Apply Tag to Back Sector
|
// 98: Apply Tag to Back Sector
|
||||||
// 99: Apply Tag to Front and Back Sectors
|
// 99: Apply Tag to Front and Back Sectors
|
||||||
if (lines[i].special == 96) {
|
if (lines[i].special == 97 || lines[i].special == 99)
|
||||||
|
P_AddBinaryMapTagsFromLine(lines[i].frontsector, &lines[i]);
|
||||||
|
if (lines[i].special == 98 || lines[i].special == 99)
|
||||||
|
P_AddBinaryMapTagsFromLine(lines[i].backsector, &lines[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Run this loop after the 97-99 loop to ensure that 96 can search through all of the
|
||||||
|
// 97-99-applied tags.
|
||||||
|
for (i = 0; i < numlines; i++) {
|
||||||
size_t j;
|
size_t j;
|
||||||
mtag_t tag = Tag_FGet(&lines[i].frontsector->tags);
|
mtag_t tag, target_tag;
|
||||||
mtag_t target_tag = Tag_FGet(&lines[i].tags);
|
|
||||||
mtag_t offset_tags[4];
|
mtag_t offset_tags[4];
|
||||||
|
|
||||||
|
// 96: Apply Tag to Tagged Sectors
|
||||||
|
if (lines[i].special != 96)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
tag = Tag_FGet(&lines[i].frontsector->tags);
|
||||||
|
target_tag = Tag_FGet(&lines[i].tags);
|
||||||
memset(offset_tags, 0, sizeof(mtag_t)*4);
|
memset(offset_tags, 0, sizeof(mtag_t)*4);
|
||||||
if (lines[i].flags & ML_EFFECT6) {
|
if (lines[i].flags & ML_EFFECT6) {
|
||||||
offset_tags[0] = (INT32)sides[lines[i].sidenum[0]].textureoffset / FRACUNIT;
|
offset_tags[0] = (INT32)sides[lines[i].sidenum[0]].textureoffset / FRACUNIT;
|
||||||
|
@ -3069,7 +3081,8 @@ static void P_AddBinaryMapTags(void)
|
||||||
|
|
||||||
for (j = 0; j < numsectors; j++) {
|
for (j = 0; j < numsectors; j++) {
|
||||||
boolean matches_target_tag = target_tag && Tag_Find(§ors[j].tags, target_tag);
|
boolean matches_target_tag = target_tag && Tag_Find(§ors[j].tags, target_tag);
|
||||||
size_t k; for (k = 0; k < 4; k++) {
|
size_t k;
|
||||||
|
for (k = 0; k < 4; k++) {
|
||||||
if (lines[i].flags & ML_EFFECT5) {
|
if (lines[i].flags & ML_EFFECT5) {
|
||||||
if (matches_target_tag || (offset_tags[k] && Tag_Find(§ors[j].tags, offset_tags[k]))) {
|
if (matches_target_tag || (offset_tags[k] && Tag_Find(§ors[j].tags, offset_tags[k]))) {
|
||||||
Tag_Add(§ors[j].tags, tag);
|
Tag_Add(§ors[j].tags, tag);
|
||||||
|
@ -3083,12 +3096,6 @@ static void P_AddBinaryMapTags(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (lines[i].special == 97 || lines[i].special == 99)
|
|
||||||
P_AddBinaryMapTagsFromLine(lines[i].frontsector, &lines[i]);
|
|
||||||
if (lines[i].special == 98 || lines[i].special == 99)
|
|
||||||
P_AddBinaryMapTagsFromLine(lines[i].backsector, &lines[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11594,7 +11594,7 @@ void P_PlayerThink(player_t *player)
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
if (!playeringame[i] || players[i].spectator || players[i].bot == BOT_2PAI || players[i].bot == BOT_2PHUMAN)
|
if (!playeringame[i] || players[i].spectator || players[i].bot)
|
||||||
continue;
|
continue;
|
||||||
if (players[i].lives <= 0)
|
if (players[i].lives <= 0)
|
||||||
continue;
|
continue;
|
||||||
|
@ -11626,7 +11626,7 @@ void P_PlayerThink(player_t *player)
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
if (!playeringame[i] || players[i].spectator || players[i].bot == BOT_2PAI || players[i].bot == BOT_2PHUMAN)
|
if (!playeringame[i] || players[i].spectator || players[i].bot)
|
||||||
continue;
|
continue;
|
||||||
if (players[i].quittime > 30 * TICRATE)
|
if (players[i].quittime > 30 * TICRATE)
|
||||||
continue;
|
continue;
|
||||||
|
@ -12750,12 +12750,12 @@ void P_PlayerAfterThink(player_t *player)
|
||||||
if (!ptera->movefactor)
|
if (!ptera->movefactor)
|
||||||
goto dropoff;
|
goto dropoff;
|
||||||
|
|
||||||
if (ptera->cusval >= 50)
|
if (ptera->cusval >= 30)
|
||||||
{
|
{
|
||||||
player->powers[pw_carry] = CR_NONE;
|
player->powers[pw_carry] = CR_NONE;
|
||||||
P_SetTarget(&player->mo->tracer, NULL);
|
P_SetTarget(&player->mo->tracer, NULL);
|
||||||
P_KillMobj(ptera, player->mo, player->mo, 0);
|
P_KillMobj(ptera, player->mo, player->mo, 0);
|
||||||
player->mo->momz = 9*FRACUNIT;
|
P_SetObjectMomZ(player->mo, 12*FRACUNIT, false);
|
||||||
player->pflags |= PF_APPLYAUTOBRAKE|PF_JUMPED|PF_THOKKED;
|
player->pflags |= PF_APPLYAUTOBRAKE|PF_JUMPED|PF_THOKKED;
|
||||||
P_SetMobjState(player->mo, S_PLAY_ROLL);
|
P_SetMobjState(player->mo, S_PLAY_ROLL);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -2291,7 +2291,7 @@ static void ST_drawTextHUD(void)
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
if (!playeringame[i] || players[i].spectator)
|
if (!playeringame[i] || players[i].spectator || players[i].bot)
|
||||||
continue;
|
continue;
|
||||||
if (players[i].lives <= 0)
|
if (players[i].lives <= 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -2023,7 +2023,7 @@ static void Y_AwardCoopBonuses(void)
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; ++i)
|
for (i = 0; i < MAXPLAYERS; ++i)
|
||||||
{
|
{
|
||||||
if (!playeringame[i] || players[i].lives < 1) // not active or game over
|
if (!playeringame[i] || players[i].lives < 1 || players[i].bot == BOT_2PAI || players[i].bot == BOT_2PHUMAN) // not active, game over or tails bot
|
||||||
bonusnum = 0; // all null
|
bonusnum = 0; // all null
|
||||||
else
|
else
|
||||||
bonusnum = mapheaderinfo[prevmap]->bonustype + 1; // -1 is none
|
bonusnum = mapheaderinfo[prevmap]->bonustype + 1; // -1 is none
|
||||||
|
@ -2073,7 +2073,7 @@ static void Y_AwardSpecialStageBonus(void)
|
||||||
{
|
{
|
||||||
oldscore = players[i].score;
|
oldscore = players[i].score;
|
||||||
|
|
||||||
if (!playeringame[i] || players[i].lives < 1) // not active or game over
|
if (!playeringame[i] || players[i].lives < 1 || players[i].bot == BOT_2PAI || players[i].bot == BOT_2PHUMAN) // not active, game over or tails bot
|
||||||
{
|
{
|
||||||
Y_SetNullBonus(&players[i], &localbonuses[0]);
|
Y_SetNullBonus(&players[i], &localbonuses[0]);
|
||||||
Y_SetNullBonus(&players[i], &localbonuses[1]);
|
Y_SetNullBonus(&players[i], &localbonuses[1]);
|
||||||
|
|
Loading…
Reference in a new issue