Fix NiGHTS hoops crashing the game for mid-level netgame joiners

This commit is contained in:
MIDIMan authored and Alug committed 2026-07-20 15:50:16 +02:00
1 parent 8880057ff2
commit 19e9eedce3
2 files changed
+20 -12

No files matched your search

+9 -7
View File
@@ -883,18 +883,20 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
break;
case MT_HOOPCOLLIDE:
// This produces a kind of 'domino effect' with the hoop's pieces.
for (; special->hprev != NULL; special = special->hprev); // Move to the first sprite in the hoop
for (; special != NULL && special->hprev != NULL; special = special->hprev); // Move to the first sprite in the hoop
i = 0;
for (; special->hnext != NULL && special->type == MT_HOOP; special = special->hnext)
for (; special != NULL && special->type == MT_HOOP; special = special->hnext)
{
if (!P_MobjWasRemoved(special->target))
if (!P_MobjWasRemoved(special))
{
special->fuse = 11;
special->movedir = i;
special->extravalue1 = special->target->extravalue1;
special->extravalue2 = special->target->extravalue2;
special->target->threshold = 4242;
if (!P_MobjWasRemoved(special->target))
{
special->extravalue1 = special->target->extravalue1;
special->extravalue2 = special->target->extravalue2;
special->target->threshold = 4242;
}
}
i++;
}
+11 -5
View File
@@ -962,7 +962,7 @@ static void P_SpawnEmeraldHunt(void)
}
}
static void P_SpawnMapThings(void)
static void P_SpawnMapThings(boolean spawnhoops)
{
size_t i;
mapthing_t *mt;
@@ -1008,10 +1008,16 @@ static void P_SpawnMapThings(void)
// spawn hoops
if (mt->type == 1705 || mt->type == 1713)
{
// Z for objects Tails 05-26-2002
mt->z = (INT16)(mtsector->floorheight >> FRACBITS);
// Check for spawnhoops here so the hoops don't spawn ghost variants for players joining a netgame mid-level
// ...It's a long story.
if (spawnhoops)
{
// Z for objects Tails 05-26-2002
mt->z = (INT16)(mtsector->floorheight >> FRACBITS);
P_SpawnHoops(mt);
}
P_SpawnHoops(mt);
continue;
}
@@ -3082,7 +3088,7 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate)
// a shit ton of time loading mobj thinkers.
CalculateDoomednumToMobjtype();
P_SpawnMapThings();
P_SpawnMapThings(!fromnetsave);
P_SpawnEmblems(!fromnetsave);