If available, add map title into crash log

This commit is contained in:
indev committed 2025-01-07 14:52:58 +03:00
1 parent dbb5c1482b
commit ce31ceda65
1 file changed
+12 -1
+12 -1
View File
@@ -178,6 +178,7 @@ static char returnWadPath[256];
#include "../d_net.h"
#include "../g_game.h"
#include "../filesrch.h"
#include "../z_zone.h" // Z_Free
#include "endtxt.h"
#include "sdlmain.h"
@@ -344,7 +345,17 @@ static void write_backtrace(bt_crash_reason_t reason)
fprintf(out, "Compiled: %s %s, commit %s, branch %s\n", compdate, comptime, comprevision, compbranch);
if (gamestate == GS_LEVEL)
fprintf(out, "Game map: %s\n", G_BuildMapName(gamemap));
{
char *title = G_BuildMapTitle(gamemap);
if (title)
{
fprintf(out, "Game map: %s (%s)\n", title, G_BuildMapName(gamemap));
Z_Free(title);
}
else
fprintf(out, "Game map: %s\n", G_BuildMapName(gamemap));
}
fprintf(out, "Time of crash: %s\n", asctime(timeinfo));