Merge branch 'badflags' into 'next'

Fix CTF flag patch garbage (resolves #506)

Closes #506

See merge request STJr/SRB2!1453
This commit is contained in:
sphere 2021-04-10 11:34:07 -04:00
commit 00e81cac8e

View file

@ -299,10 +299,6 @@ void ST_LoadGraphics(void)
gravboots = W_CachePatchName("TVGVICON", PU_HUDGFX); gravboots = W_CachePatchName("TVGVICON", PU_HUDGFX);
tagico = W_CachePatchName("TAGICO", PU_HUDGFX); tagico = W_CachePatchName("TAGICO", PU_HUDGFX);
rflagico = W_CachePatchName("RFLAGICO", PU_HUDGFX);
bflagico = W_CachePatchName("BFLAGICO", PU_HUDGFX);
rmatcico = W_CachePatchName("RMATCICO", PU_HUDGFX);
bmatcico = W_CachePatchName("BMATCICO", PU_HUDGFX);
gotrflag = W_CachePatchName("GOTRFLAG", PU_HUDGFX); gotrflag = W_CachePatchName("GOTRFLAG", PU_HUDGFX);
gotbflag = W_CachePatchName("GOTBFLAG", PU_HUDGFX); gotbflag = W_CachePatchName("GOTBFLAG", PU_HUDGFX);
fnshico = W_CachePatchName("FNSHICO", PU_HUDGFX); fnshico = W_CachePatchName("FNSHICO", PU_HUDGFX);
@ -2363,27 +2359,29 @@ static inline void ST_drawRaceHUD(void)
static void ST_drawTeamHUD(void) static void ST_drawTeamHUD(void)
{ {
patch_t *p;
#define SEP 20 #define SEP 20
if (F_GetPromptHideHud(0)) // y base is 0 if (F_GetPromptHideHud(0)) // y base is 0
return; return;
if (gametyperules & GTR_TEAMFLAGS) rflagico = W_CachePatchName("RFLAGICO", PU_HUDGFX);
p = bflagico; bflagico = W_CachePatchName("BFLAGICO", PU_HUDGFX);
else rmatcico = W_CachePatchName("RMATCICO", PU_HUDGFX);
p = bmatcico; bmatcico = W_CachePatchName("BMATCICO", PU_HUDGFX);
if (LUA_HudEnabled(hud_teamscores)) if (LUA_HudEnabled(hud_teamscores))
V_DrawSmallScaledPatch(BASEVIDWIDTH/2 - SEP - (p->width / 4), 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, p); {
if (gametyperules & GTR_TEAMFLAGS)
if (gametyperules & GTR_TEAMFLAGS) {
p = rflagico; V_DrawSmallScaledPatch(BASEVIDWIDTH/2 - SEP - (bflagico->width / 4), 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, bflagico);
else V_DrawSmallScaledPatch(BASEVIDWIDTH/2 + SEP - (rflagico->width / 4), 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, rflagico);
p = rmatcico; }
else
if (LUA_HudEnabled(hud_teamscores)) {
V_DrawSmallScaledPatch(BASEVIDWIDTH/2 + SEP - (p->width / 4), 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, p); V_DrawSmallScaledPatch(BASEVIDWIDTH/2 - SEP - (bmatcico->width / 4), 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, bmatcico);
V_DrawSmallScaledPatch(BASEVIDWIDTH/2 + SEP - (rmatcico->width / 4), 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, rmatcico);
}
}
if (!(gametyperules & GTR_TEAMFLAGS)) if (!(gametyperules & GTR_TEAMFLAGS))
goto num; goto num;