If available, add map title into crash log

This commit is contained in:
indev authored and Alug committed 2025-01-07 16:30:37 +01:00
1 parent ae8629ecba
commit 0f245f52b1
1 file changed
+12 -1
+12 -1
View File
@@ -182,6 +182,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"
@@ -348,7 +349,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));