Skip to content
Snippets Groups Projects

Sectorlist traversal

Merged toaster requested to merge sectorlist_traversal into next

MOM GET THE CAMERA

There's a LOT of code in the source that ended up mixing m_snext (the node for the next thing in the sector's thinglist) and m_tnext (the node for the next sector in the thing's sectorlist), so I renamed the following:

  • m_snext ==> m_thinglist_next
  • m_sprev ==> m_thinglist_prev
  • m_tnext ==> m_sectorlist_next
  • m_tprev ==> m_sectorlist_prev

Then, I changed all the instances where the code was trying to go m_thinglist_next on a mobj's touching_sectorlist (which would've just gone to the node for the next thing in the same sector, instead of the node for the next sector for the same thing). Notable samples:

  • FF_SHATTER blocks now disappear the moment you go into their sector. You still can't give FF_SOLID to them because in that case they will still stop you if you never enter their sector at all (ie - clip on corners), but having them nonsolid no longer allows you to phase through entirely without busting them (which was the whole downside of making them intangible in the first place).
  • You can now bump into multiple Mario blocks at a time, even if you're not exclusively in their sector.
  • No more getting randomly stopped on the edges of bouncy FOFs.
  • Landing on polyobjects might behave a little more consistently at the edge of their host sector.
  • Teetering did a SHITTON of code that basically never got executed, and then had directly-blockmap-accessing code as a backup. The code was activatable by replacing the m_thinglist_next with m_sectorlist_next, but it behaved SUPER differently from what we're used to with teetering (if the player mobj's edge was JUST off the edge of a platform, you ended up in teetering frames - even if it looked like you could stand) so I ended up removing that section entirely.

Any objections?

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • :thumbsup: Got to love it when the fixes for seemingly complicated issues turn out to be hilariously simple. Nice find there.

    I think the problem here was that m_tprev/m_tnext and m_sprev/m_snext are really easy to mix up by name (and purpose), it's no wonder nobody noticed the slipups for over a decade it turns out lol.

  • Btw in p_mobj.c at least there's four more of the same kind of error. And in p_user.c two more, and in p_spec.c two more as well!

  • Author Contributor

    can't sleep, too hype about this fix

    I think what I'm gonna do once I get up is rename those fields to sector_thinglist_next/prev and thing_sectorlist_next/prev. Less ambiguous, no need for macros, makes it clear what it should belong to and what you're going to want to use it for.

    I'll check out the other errors then, btw, but no auto findreplace since I figure there ARE potential legitimate uses of iterating through thing nodes instead of sector nodes...

  • toaster Added 1 new commit:

    Added 1 new commit:

    • 17e0adcb - Renamed some struct variables so the problem this branch sets out to fix is more…
  • There, made comments on all the places that are still wrong

  • toaster Added 1 new commit:

    Added 1 new commit:

    • 7af14c20 - Everywhere in the code that was doing things wrong has been changed.
  • Author Contributor

    Haha MI thanks a lot but I didn't need your help here :P Didn't even see you'd done this until after I'd committed!!

  • Lol okay then, may as well remove them I guess

  • toaster
    toaster @toaster started a thread on commit 7af14c20
2849 2849 //
2850 2850 static void P_DoTeeter(player_t *player)
2851 2851 {
2852 msecnode_t *node;
2853 2852 boolean teeter = false;
2854 2853 boolean roverfloor; // solid 3d floors?
2855 boolean checkedforteeter = false;
2856 2854 const fixed_t tiptop = FixedMul(MAXSTEPMOVE, player->mo->scale); // Distance you have to be above the ground in order to teeter.
2857 2855
2858 for (node = player->mo->touching_sectorlist; node; node = node->m_thinglist_next)
  • Author Contributor

    This'll probably make merging in toast_slopes a relative nightmare but whatever, it led to some Akward Teetering Scenarios in GFZ when you were standing JUST slightly close enough to an edge when you had plenty of feet space available

  • :thumbsup: I don't see any issues here.

  • Inuyasha mentioned in commit 8fc61bb6

    mentioned in commit 8fc61bb6

  • Inuyasha Status changed to merged

    Status changed to merged

  • Please register or sign in to reply
    Loading