Skip to content

Conversation

@fabiangreffrath
Copy link
Owner

No description provided.

@fabiangreffrath
Copy link
Owner Author

This fixes the alienstcE2M5.lmp desync. I am still not sure what the underlying issue is, but it seems that the MBF code changes the order of mobj_t * elements in the blocklinks[] arrays.

@fabiangreffrath fabiangreffrath marked this pull request as ready for review May 8, 2025 14:56
@fabiangreffrath
Copy link
Owner Author

I only set the function pointers at the start of each map, so the COMP cheat continues to work.

@fabiangreffrath fabiangreffrath changed the title use the Vanilla P_UnsetThingPosition()/P_SetThingPosition() for Boom and earlier use Boom's P_UnsetThingPosition()/P_SetThingPosition() for Boom and earlier May 8, 2025
@fabiangreffrath fabiangreffrath marked this pull request as draft May 30, 2025 10:02
@elf-alchemist
Copy link
Collaborator

Has this change thoroughly demo-tested? (Or will it later?) Obviously it should be made in order to match up with vanilla, certainly, but of course there's the possibility that newer vanilla/boom demos that may get screwed by this -- I guess my question is "how many of the newer demos will be desynced?"

This is also a similar consideration with the "planes differ" issue from DSDA (kraflab/dsda-doom#704) where in a implementation detail was quietly changed that caused backwards compat issues.

@Pedro-Beirao
Copy link
Contributor

Has this change thoroughly demo-tested?

This has been tested against all dsdarchive demos with dsda-doom. It fixes the demos that desync, and makes the game hang against a few other demos.

This is expected, in vanilla those demos also hang.

But having the game hang isnt a good thing, so I think the plan is to catch the expection with I_Error()
Atleast thats why I havent merged it for dsda-doom yet

@fabiangreffrath
Copy link
Owner Author

But having the game hang isnt a good thing, so I think the plan is to catch the expection with I_Error() Atleast thats why I havent merged it for dsda-doom yet

--- a/src/p_maputl.c
+++ b/src/p_maputl.c
@@ -26,6 +26,7 @@
 #include "doomdata.h"
 #include "doomstat.h"
 #include "i_printf.h"
+#include "i_system.h"
 #include "m_bbox.h"
 #include "p_map.h"
 #include "p_maputl.h"
@@ -546,14 +547,18 @@ boolean blockmapfix;
 boolean P_BlockThingsIterator(int x, int y, boolean func(mobj_t*),
                               boolean do_blockmapfix)
 {
-  mobj_t *mobj;
+  mobj_t *mobj, *first;
 
   if (x < 0 || y < 0 || x >= bmapwidth || y >= bmapheight)
     return true;
 
-  for (mobj = blocklinks[y*bmapwidth+x]; mobj; mobj = mobj->bnext)
+  for (mobj = blocklinks[y*bmapwidth+x], first = mobj; mobj; mobj = mobj->bnext)
+  {
     if (!func(mobj))
       return false;
+    if (mobj->bnext == first)
+      I_Error("infitnite loop detected!");
+  }
 
   // Blockmap bug fix by Terry Hearst
   // https://github.com/fabiangreffrath/crispy-doom/pull/723

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants