Skip to content

Plane movement thinker cleanup

MascaraSnake requested to merge thinker-cleanup into next

This branch cleans up some of the mess that is p_floor.c and its plane movement thinkers:

  • Get rid of the generic levelspecthink_t thinker structs and replace it with tailormade structs for each thinker.
  • Remove thinker for the spike sector type, which hasn't been necessary even since the damagetype revamp.
  • Code refactoring: Get rid of duplicated code, streamline convoluted and inefficient control flow.
  • Add crumblestate_t enum to get rid of the magic numbers for crumblestate.
  • Remove return values from a couple of elevator functions that don't need them.

Along the way, I also stumbled across two bugs that I fixed:

  • The "reverse adjustable air bobbing FOF" type is now actually adjustable.
  • "Each time" triggers that are set to also trigger on sector exit no longer do so for players in the sector that disappear (e.g., die, spectate, leaves the game).

Because all the thinker structs are netgame-synced, this MR will require netgame testing. In particular, we need to check if the following linedef specials are properly synced:

  • Continuously falling sector (linedef type 52)
  • Air bobbing FOFs, including RVZ's dynamically sinking platforms (linedef types 150-153, 176, 177, 180)
  • Floatbob FOFs (linedef types 160, 176-179)
  • Crumbling FOFs (linedef types 170-180)
  • Rising FOFs (linedef types 190-195)
  • Mario (linedef type 250)
  • Thwomp (linedef type 251)
  • "Each Time" linedef executor triggers
  • "No More Enemies" linedef executor trigger (linedef type 313)

srb2win-thinker.exe

Edited by MascaraSnake

Merge request reports