From 043de8c780bd6c7a18067cd57a939f466ae5cf34 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 27 Sep 2020 19:56:50 +0200 Subject: [PATCH] Revert "- avoid double linking to and unlinking from the world for actors." This reverts commit 8fc9f1e5ef8a10b5eaad0b90723e02ab7abf4cb8. As I already feared, this does not work right. The entire linking/unlinking code is simply too fragile. So no protection here against inept tinkering. --- src/playsim/actor.h | 1 - src/playsim/p_maputl.cpp | 13 ------------- src/playsim/p_mobj.cpp | 2 +- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/playsim/actor.h b/src/playsim/actor.h index be930f1a8..063eead84 100644 --- a/src/playsim/actor.h +++ b/src/playsim/actor.h @@ -414,7 +414,6 @@ enum ActorFlag8 MF8_STOPRAILS = 0x00000200, // [MC] Prevent rails from going further if an actor has this flag. MF8_ABSVIEWANGLES = 0x00000400, // [MC] By default view angle/pitch/roll is an offset. This will make it absolute instead. MF8_FALLDAMAGE = 0x00000800, // Monster will take fall damage regardless of map settings. - MF8_LINKEDTOWORLD = 0x00010000, // actor is currently linked to the blockmap and sector chain. }; diff --git a/src/playsim/p_maputl.cpp b/src/playsim/p_maputl.cpp index 567375162..ffc7a1f43 100644 --- a/src/playsim/p_maputl.cpp +++ b/src/playsim/p_maputl.cpp @@ -286,12 +286,6 @@ void P_LineOpening (FLineOpening &open, AActor *actor, const line_t *linedef, co void AActor::UnlinkFromWorld (FLinkContext *ctx) { if (ctx != nullptr) ctx->sector_list = nullptr; - if (!(flags8 & MF8_LINKEDTOWORLD)) - { - //assert(false); - return; - } - flags8 &= ~MF8_LINKEDTOWORLD; if (!(flags & MF_NOSECTOR)) { // invisible things don't need to be in sector list @@ -449,12 +443,6 @@ bool AActor::FixMapthingPos() void AActor::LinkToWorld(FLinkContext *ctx, bool spawningmapthing, sector_t *sector) { - if (flags8 & MF8_LINKEDTOWORLD) - { - //assert(false); - return; - } - bool spawning = spawningmapthing; if (spawning) @@ -480,7 +468,6 @@ void AActor::LinkToWorld(FLinkContext *ctx, bool spawningmapthing, sector_t *sec Sector = sector; subsector = Level->PointInRenderSubsector(Pos()); // this is from the rendering nodes, not the gameplay nodes! section = subsector->section; - flags8 |= MF8_LINKEDTOWORLD; if (!(flags & MF_NOSECTOR)) { diff --git a/src/playsim/p_mobj.cpp b/src/playsim/p_mobj.cpp index 728ce185e..7e8d54713 100644 --- a/src/playsim/p_mobj.cpp +++ b/src/playsim/p_mobj.cpp @@ -371,7 +371,7 @@ void AActor::Serialize(FSerializer &arc) SerializeTerrain(arc, "floorterrain", floorterrain, &def->floorterrain); SerializeArgs(arc, "args", args, def->args, special); - if (arc.isReading()) flags8 &= ~MF8_LINKEDTOWORLD; + } #undef A