diff --git a/src/g_shared/a_action.cpp b/src/g_shared/a_action.cpp index ddfd23268f..aed8457f8c 100644 --- a/src/g_shared/a_action.cpp +++ b/src/g_shared/a_action.cpp @@ -142,21 +142,25 @@ void DCorpsePointer::OnDestroy () TThinkerIterator iterator (STAT_CORPSEPOINTER); DCorpsePointer *first = iterator.Next (); - int prevCount = first->Count; - - if (first == this) + // During a serialization unwind the thinker list won't be available. + if (first != nullptr) { - first = iterator.Next (); - } + int prevCount = first->Count; - if (first != NULL) - { - first->Count = prevCount - 1; - } + if (first == this) + { + first = iterator.Next(); + } + if (first != NULL) + { + first->Count = prevCount - 1; + } + + } if (Corpse != NULL) { - Corpse->Destroy (); + Corpse->Destroy(); } Super::OnDestroy(); } diff --git a/src/m_random.cpp b/src/m_random.cpp index 60ce12fd6b..697bb173f1 100644 --- a/src/m_random.cpp +++ b/src/m_random.cpp @@ -156,6 +156,7 @@ FRandom::FRandom () #endif Next = RNGList; RNGList = this; + Init(0); } //========================================================================== @@ -199,6 +200,7 @@ FRandom::FRandom (const char *name) Next = probe; *prev = this; + Init(0); } //========================================================================== diff --git a/src/p_map.cpp b/src/p_map.cpp index ac5ca10a7c..4e5cc31fd5 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -3532,7 +3532,14 @@ bool P_BounceActor(AActor *mo, AActor *BlockingMobj, bool ontop) || ((mo->flags6 & MF6_NOBOSSRIP) && (BlockingMobj->flags2 & MF2_BOSS))) && (BlockingMobj->flags2 & MF2_REFLECTIVE)) || ((BlockingMobj->player == NULL) && (!(BlockingMobj->flags3 & MF3_ISMONSTER))))) { - if (mo->bouncecount > 0 && --mo->bouncecount == 0) return false; + if (mo->bouncecount>0 && --mo->bouncecount == 0) + { + if (mo->flags & MF_MISSILE) + P_ExplodeMissile(mo, nullptr, nullptr); + else + mo->CallDie(nullptr, nullptr); + return true; + } if (mo->flags7 & MF7_HITTARGET) mo->target = BlockingMobj; if (mo->flags7 & MF7_HITMASTER) mo->master = BlockingMobj; diff --git a/src/r_data/sprites.cpp b/src/r_data/sprites.cpp index b384211fc6..7fb59ef949 100644 --- a/src/r_data/sprites.cpp +++ b/src/r_data/sprites.cpp @@ -63,7 +63,7 @@ static bool R_InstallSpriteLump (FTextureID lump, unsigned frame, char rot, bool if (frame >= MAX_SPRITE_FRAMES || rotation > 16) { - Printf (TEXTCOLOR_RED"R_InstallSpriteLump: Bad frame characters in lump %s\n", TexMan[lump]->Name.GetChars()); + Printf (TEXTCOLOR_RED "R_InstallSpriteLump: Bad frame characters in lump %s\n", TexMan[lump]->Name.GetChars()); return false; } diff --git a/src/scripting/decorate/thingdef_parse.cpp b/src/scripting/decorate/thingdef_parse.cpp index 9b78ef3d57..505585937e 100644 --- a/src/scripting/decorate/thingdef_parse.cpp +++ b/src/scripting/decorate/thingdef_parse.cpp @@ -1217,9 +1217,8 @@ static void ParseDamageDefinition(FScanner &sc) // //========================================================================== -void ParseDecorate (FScanner &sc) +void ParseDecorate (FScanner &sc, PNamespace *ns) { - auto ns = Namespaces.NewNamespace(sc.LumpNum); // Get actor class name. for(;;) { @@ -1245,7 +1244,7 @@ void ParseDecorate (FScanner &sc) } FScanner newscanner; newscanner.Open(sc.String); - ParseDecorate(newscanner); + ParseDecorate(newscanner, ns); break; } @@ -1308,6 +1307,7 @@ void ParseAllDecorate() while ((lump = Wads.FindLump("DECORATE", &lastlump)) != -1) { FScanner sc(lump); - ParseDecorate(sc); + auto ns = Namespaces.NewNamespace(sc.LumpNum); + ParseDecorate(sc, ns); } } \ No newline at end of file