From 4e30326ff86c1a4137d3e755c1e485202f2bd928 Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 26 Jul 2025 16:16:31 +0200 Subject: [PATCH] move assignments after early returns ST_drawLevelTitle --- src/st_stuff.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 16a45ea59..d429cf719 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -419,27 +419,28 @@ static void ST_drawDebugInfo(void) static void ST_drawLevelTitle(void) { - char *lvlttl = mapheaderinfo[gamemap-1]->lvlttl; - char *subttl = mapheaderinfo[gamemap-1]->subttl; - char *zonttl = mapheaderinfo[gamemap-1]->zonttl; // SRB2kart - char *actnum = mapheaderinfo[gamemap-1]->actnum; - INT32 lvlttlxpos; - INT32 ttlnumxpos; - INT32 zonexpos; - INT32 dupcalc = (vid.width/vid.dupx); - UINT8 gtc = G_GetGametypeColor(gametype); + char *lvlttl, *subttl, *zonttl, *actnum; + INT32 lvlttlxpos, ttlnumxpos, zonexpos; + INT32 dupcalc; + UINT8 gtc; INT32 sub = 0; - INT32 bary = (splitscreen) - ? BASEVIDHEIGHT/2 - : 163; + INT32 bary; INT32 lvlw; - if (!cv_stagetitle.value) + if (!cv_stagetitle.value || (timeinmap > 113)) return; - if (timeinmap > 113) + if (*mapheaderinfo[gamemap-1]->lvlttl == '\0') return; + lvlttl = mapheaderinfo[gamemap-1]->lvlttl; + subttl = mapheaderinfo[gamemap-1]->subttl; + zonttl = mapheaderinfo[gamemap-1]->zonttl; // SRB2kart + actnum = mapheaderinfo[gamemap-1]->actnum; + dupcalc = (vid.width/vid.dupx); + gtc = G_GetGametypeColor(gametype); + bary = (splitscreen) ? BASEVIDHEIGHT/2 : 163; + lvlw = V_LevelNameWidth(lvlttl); if (actnum[0]) @@ -603,7 +604,7 @@ static void ST_overlayDrawer(void) } // draw level title Tails - if (*mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer) && !mapreset) && LUA_HudEnabled(hud_stagetitle) && !forceshowhud) + if (!(hu_showscores && (netgame || multiplayer) && !mapreset) && LUA_HudEnabled(hud_stagetitle) && !forceshowhud) ST_drawLevelTitle(); if (!hu_showscores && netgame && !mapreset)