This commit is contained in:
Rachael Alexanderson 2017-01-27 11:33:05 -05:00
commit 5cbe829c05
5 changed files with 29 additions and 16 deletions

View file

@ -142,21 +142,25 @@ void DCorpsePointer::OnDestroy ()
TThinkerIterator<DCorpsePointer> iterator (STAT_CORPSEPOINTER); TThinkerIterator<DCorpsePointer> iterator (STAT_CORPSEPOINTER);
DCorpsePointer *first = iterator.Next (); DCorpsePointer *first = iterator.Next ();
int prevCount = first->Count; // During a serialization unwind the thinker list won't be available.
if (first != nullptr)
if (first == this)
{ {
first = iterator.Next (); int prevCount = first->Count;
}
if (first != NULL) if (first == this)
{ {
first->Count = prevCount - 1; first = iterator.Next();
} }
if (first != NULL)
{
first->Count = prevCount - 1;
}
}
if (Corpse != NULL) if (Corpse != NULL)
{ {
Corpse->Destroy (); Corpse->Destroy();
} }
Super::OnDestroy(); Super::OnDestroy();
} }

View file

@ -156,6 +156,7 @@ FRandom::FRandom ()
#endif #endif
Next = RNGList; Next = RNGList;
RNGList = this; RNGList = this;
Init(0);
} }
//========================================================================== //==========================================================================
@ -199,6 +200,7 @@ FRandom::FRandom (const char *name)
Next = probe; Next = probe;
*prev = this; *prev = this;
Init(0);
} }
//========================================================================== //==========================================================================

View file

@ -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)) || ((mo->flags6 & MF6_NOBOSSRIP) && (BlockingMobj->flags2 & MF2_BOSS))) && (BlockingMobj->flags2 & MF2_REFLECTIVE))
|| ((BlockingMobj->player == NULL) && (!(BlockingMobj->flags3 & MF3_ISMONSTER))))) || ((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_HITTARGET) mo->target = BlockingMobj;
if (mo->flags7 & MF7_HITMASTER) mo->master = BlockingMobj; if (mo->flags7 & MF7_HITMASTER) mo->master = BlockingMobj;

View file

@ -63,7 +63,7 @@ static bool R_InstallSpriteLump (FTextureID lump, unsigned frame, char rot, bool
if (frame >= MAX_SPRITE_FRAMES || rotation > 16) 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; return false;
} }

View file

@ -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. // Get actor class name.
for(;;) for(;;)
{ {
@ -1245,7 +1244,7 @@ void ParseDecorate (FScanner &sc)
} }
FScanner newscanner; FScanner newscanner;
newscanner.Open(sc.String); newscanner.Open(sc.String);
ParseDecorate(newscanner); ParseDecorate(newscanner, ns);
break; break;
} }
@ -1308,6 +1307,7 @@ void ParseAllDecorate()
while ((lump = Wads.FindLump("DECORATE", &lastlump)) != -1) while ((lump = Wads.FindLump("DECORATE", &lastlump)) != -1)
{ {
FScanner sc(lump); FScanner sc(lump);
ParseDecorate(sc); auto ns = Namespaces.NewNamespace(sc.LumpNum);
ParseDecorate(sc, ns);
} }
} }