From 16ee57817d28765c9c4fd957729f4df481701057 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 13 Jan 2019 10:34:17 +0200 Subject: [PATCH 1/3] - fixed crash with stored commands on startup Example: +map CCMD in command line options --- src/dthinker.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dthinker.cpp b/src/dthinker.cpp index 39db91a7d9..a519195a4f 100644 --- a/src/dthinker.cpp +++ b/src/dthinker.cpp @@ -242,7 +242,11 @@ DThinker::DThinker (int statnum) throw() { NextThinker = NULL; PrevThinker = NULL; - Level = bSerialOverride? nullptr : currentSession->Levelinfo[0]; // do this properly later. + Level = bSerialOverride + ? nullptr + : currentSession == nullptr + ? nullptr + : currentSession->Levelinfo[0]; // do this properly later. if (bSerialOverride) { // The serializer will insert us into the right list return; From 2bb3571c2c6d48ef3e995d0cb7bf7c0a10281dff Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 13 Jan 2019 10:35:00 +0200 Subject: [PATCH 2/3] - fixed crash during initialization of polyobjects --- src/maploader/polyobjects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/maploader/polyobjects.cpp b/src/maploader/polyobjects.cpp index b8449521fe..e28c5f53c5 100644 --- a/src/maploader/polyobjects.cpp +++ b/src/maploader/polyobjects.cpp @@ -315,7 +315,7 @@ void MapLoader::TranslateToStartSpot (int tag, const DVector2 &origin) } po->CalcCenter(); // For compatibility purposes - po->CenterSubsector = R_PointInSubsector(po->GetLevel(), po->CenterSpot.pos); + po->CenterSubsector = R_PointInSubsector(Level, po->CenterSpot.pos); } //========================================================================== From d3eb983dd314a9b29f3dec519ded4bd66eb34aee Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 13 Jan 2019 12:24:17 +0200 Subject: [PATCH 3/3] - fixed loading of saved game Wrong FName constructor was picked for name of map snapshot, it was not restored because of that --- src/g_level.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_level.cpp b/src/g_level.cpp index 313eaf2c1d..3b673ffb44 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -2065,7 +2065,7 @@ void G_ReadSnapshots(FResourceFile *resf) if (ptr != nullptr) { ptrdiff_t maplen = ptr - resl->FullName.GetChars(); - FName mapname(resl->FullName.GetChars(), (size_t)maplen); + FName mapname(resl->FullName.GetChars(), (size_t)maplen, false); currentSession->Snapshots.Insert(mapname, resl->GetRawData()); } }