mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-01-02 05:02:55 +00:00
Do not overwrite compbranch in case of detached HEAD
This commit is contained in:
parent
55636fa690
commit
94e3050f10
4 changed files with 16 additions and 9 deletions
17
src/d_main.c
17
src/d_main.c
|
|
@ -1189,6 +1189,17 @@ D_ConvertVersionNumbers (void)
|
|||
#endif
|
||||
}
|
||||
|
||||
const char *D_GetFancyBranchName(void)
|
||||
{
|
||||
if (!strcmp(compbranch, ""))
|
||||
{
|
||||
// \x8b = aqua highlight
|
||||
return "\x8b" "detached HEAD" "\x80";
|
||||
}
|
||||
|
||||
return compbranch;
|
||||
}
|
||||
|
||||
//
|
||||
// D_SRB2Main
|
||||
//
|
||||
|
|
@ -1206,12 +1217,6 @@ void D_SRB2Main(void)
|
|||
/* break the version string into version numbers, for netplay */
|
||||
D_ConvertVersionNumbers();
|
||||
|
||||
if (!strcmp(compbranch, ""))
|
||||
{
|
||||
// \x8b = aqua highlight
|
||||
compbranch = "\x8b" "detached HEAD" "\x80";
|
||||
}
|
||||
|
||||
#ifdef DEVELOP
|
||||
D_AbbrevCommit();
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ void D_SRB2Loop(void) FUNCNORETURN;
|
|||
//
|
||||
void D_SRB2Main(void);
|
||||
|
||||
const char *D_GetFancyBranchName(void);
|
||||
|
||||
// Called by IO functions when input is detected.
|
||||
void D_PostEvent(const event_t *ev);
|
||||
#if defined (PC_DOS) && !defined (DOXYGEN)
|
||||
|
|
|
|||
|
|
@ -4772,9 +4772,9 @@ static void Command_ListDoomednums_f(void)
|
|||
static void Command_Version_f(void)
|
||||
{
|
||||
#ifdef DEVELOP
|
||||
CONS_Printf("Ring Racers %s %s %s (%s %s)\n", compbranch, comprevision, compnote, compdate, comptime);
|
||||
CONS_Printf("Ring Racers %s %s %s (%s %s)\n", D_GetFancyBranchName(), comprevision, compnote, compdate, comptime);
|
||||
#else
|
||||
CONS_Printf("Ring Racers %s (%s %s %s %s) ", VERSIONSTRING, compdate, comptime, comprevision, compbranch);
|
||||
CONS_Printf("Ring Racers %s (%s %s %s %s) ", VERSIONSTRING, compdate, comptime, comprevision, D_GetFancyBranchName());
|
||||
#endif
|
||||
|
||||
// Base library
|
||||
|
|
|
|||
|
|
@ -1914,7 +1914,7 @@ void F_VersionDrawer(void)
|
|||
addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, va("%s", compdate));
|
||||
#elif defined(DEVELOP)
|
||||
addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, va("%s %s", comprevision, compnote));
|
||||
addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, compbranch);
|
||||
addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, D_GetFancyBranchName());
|
||||
#else // Regular build
|
||||
addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, va("%s", VERSIONSTRING));
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue