From d558cf51a9819723969b18d715a9162982c8a7ca Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 8 Oct 2013 19:59:46 -0500 Subject: [PATCH 1/3] - Fixed: ABackpackItem::CreateTossable did not check for failure from the supermethod. --- src/g_shared/a_pickups.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index 3ebcedb40..cc559ea94 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -1792,7 +1792,10 @@ bool ABackpackItem::HandlePickup (AInventory *item) AInventory *ABackpackItem::CreateTossable () { ABackpackItem *pack = static_cast(Super::CreateTossable()); - pack->bDepleted = true; + if (pack != NULL) + { + pack->bDepleted = true; + } return pack; } From 3c376aa342994971e0e3f578476e8085d346cdf1 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 8 Oct 2013 20:18:35 -0500 Subject: [PATCH 2/3] Move C_ExecCmdLineParams() call slightly later in the startup process. - Fixed: You could not set any CVARINFO-defined cvars from the command line because command line console commands were executed before wads were even loaded. Off the top of my head, I can't think of anything that would\ break by having them get executed after wads are loaded. --- src/d_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index ae1c5144d..507938519 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -2281,8 +2281,6 @@ void D_DoomMain (void) execFiles = Args->GatherFiles ("-exec"); D_MultiExec (execFiles, true); - C_ExecCmdLineParams (); // [RH] do all +set commands on the command line - CopyFiles(allwads, pwads); // Since this function will never leave we must delete this array here manually. @@ -2298,6 +2296,8 @@ void D_DoomMain (void) // Now that wads are loaded, define mod-specific cvars. ParseCVarInfo(); + C_ExecCmdLineParams (); // [RH] do all +set commands on the command line + // [RH] Initialize localizable strings. GStrings.LoadStrings (false); From 0c9c624e8cfeeff5fbd78fb1641749d34e08bff9 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 8 Oct 2013 21:32:26 -0500 Subject: [PATCH 3/3] Do not follow NextThinker links in DestroyThinkersInList - Fixed: DThinker::Destroy(Most)ThinkersInList() were unreliable when destroyed thinkers destroyed more thinkers in the same list. Specifically, if the thinker it destroyed caused the very next thinker in the list to also be destroyed, it would get lost in the thinker list and end up with a NULL node. So just keep iterating through the first thinker in the list until there are none left. Since destroying a thinker causes it to remove itself from its list, the first thinker will always be changing as long as there's something to destroy. --- src/dthinker.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/dthinker.cpp b/src/dthinker.cpp index 15206dabd..5405051e7 100644 --- a/src/dthinker.cpp +++ b/src/dthinker.cpp @@ -357,12 +357,10 @@ void DThinker::DestroyThinkersInList (FThinkerList &list) { if (list.Sentinel != NULL) { - DThinker *node = list.Sentinel->NextThinker; - while (node != list.Sentinel) + for (DThinker *node = list.Sentinel->NextThinker; node != list.Sentinel; node = list.Sentinel->NextThinker) { - DThinker *next = node->NextThinker; + assert(node != NULL); node->Destroy(); - node = next; } list.Sentinel->Destroy(); list.Sentinel = NULL; @@ -380,9 +378,8 @@ void DThinker::DestroyMostThinkersInList (FThinkerList &list, int stat) // it from the list. G_FinishTravel() will find it later from // a players[].mo link and destroy it then, after copying various // information to a new player. - for (DThinker *probe = list.Sentinel->NextThinker, *next; probe != list.Sentinel; probe = next) + for (DThinker *probe = list.Sentinel->NextThinker; probe != list.Sentinel; probe = list.Sentinel->NextThinker) { - next = probe->NextThinker; if (!probe->IsKindOf(RUNTIME_CLASS(APlayerPawn)) || // <- should not happen static_cast(probe)->player == NULL || static_cast(probe)->player->mo != probe)