Correct some extant fuckups.

This commit is contained in:
toaster 2019-07-14 14:21:32 +01:00
parent 323d5d61d3
commit b3e953c8c3
2 changed files with 12 additions and 6 deletions

View File

@ -230,13 +230,19 @@ void P_RemoveThinkerDelayed(thinker_t *thinker)
{
thinker_t *next;
#ifdef PARANOIA
if (thinker->next)
thinker->next = NULL;
else if (thinker->references) // Usually gets cleared up in one frame; what's going on here, then?
CONS_Printf("Number of potentially faulty references: %d\n", thinker->references);
#endif
#define BEENAROUNDBIT (0x40000000) // has to be sufficiently high that it's unlikely to happen in regular gameplay. If you change this, pay attention to the bit pattern of INT32_MIN.
if (thinker->references & ~BEENAROUNDBIT)
{
if (thinker->references & BEENAROUNDBIT) // Usually gets cleared up in one frame; what's going on here, then?
CONS_Printf("Number of potentially faulty references: %d\n", (thinker->references & ~BEENAROUNDBIT));
thinker->references |= BEENAROUNDBIT;
return;
}
#undef BEENAROUNDBIT
#else
if (thinker->references)
return;
#endif
/* Remove from main thinker list */
next = thinker->next;