From ce31ceda651cdefbee9aaebefcbc7d5bf494eeaf Mon Sep 17 00:00:00 2001 From: Indev Date: Tue, 7 Jan 2025 14:52:19 +0300 Subject: [PATCH] If available, add map title into crash log --- src/sdl/i_system.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index ff1651c3b..d3de6f6b0 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -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));