From dbd5ddf95d0e63902954d3e7ef8f63b2a99bac7e Mon Sep 17 00:00:00 2001
From: Sally Coolatta <tehrealsalt@gmail.com>
Date: Mon, 25 Apr 2022 16:49:07 -0400
Subject: [PATCH] Add interpolation to more moving plane types

Adds interpolation to the following:
- Crumbling platforms
- Mario blocks
- Floatbob platforms (this one works really strangely due to two thinkers, maybe double-check this one?)
---
 src/p_floor.c | 12 ++++++++++++
 src/p_spec.c  |  4 ++++
 2 files changed, 16 insertions(+)

diff --git a/src/p_floor.c b/src/p_floor.c
index 5fcefd2035..e583f8c66e 100644
--- a/src/p_floor.c
+++ b/src/p_floor.c
@@ -2303,6 +2303,10 @@ void EV_BounceSector(sector_t *sec, fixed_t momz, line_t *sourceline)
 	bouncer->speed = momz/2;
 	bouncer->distance = FRACUNIT;
 	bouncer->low = true;
+
+	// interpolation
+	R_CreateInterpolator_SectorPlane(&bouncer->thinker, sec, false);
+	R_CreateInterpolator_SectorPlane(&bouncer->thinker, sec, true);
 }
 
 // For T_ContinuousFalling special
@@ -2384,6 +2388,10 @@ INT32 EV_StartCrumble(sector_t *sec, ffloor_t *rover, boolean floating,
 
 	crumble->sector->crumblestate = CRUMBLE_ACTIVATED;
 
+	// interpolation
+	R_CreateInterpolator_SectorPlane(&crumble->thinker, sec, false);
+	R_CreateInterpolator_SectorPlane(&crumble->thinker, sec, true);
+
 	TAG_ITER_SECTORS(tag, i)
 	{
 		foundsec = &sectors[i];
@@ -2435,6 +2443,10 @@ void EV_MarioBlock(ffloor_t *rover, sector_t *sector, mobj_t *puncher)
 		block->ceilingstartheight = block->sector->ceilingheight;
 		block->tag = (INT16)Tag_FGet(&sector->tags);
 
+		// interpolation
+		R_CreateInterpolator_SectorPlane(&block->thinker, roversec, false);
+		R_CreateInterpolator_SectorPlane(&block->thinker, roversec, true);
+
 		if (itsamonitor)
 		{
 			oldx = thing->x;
diff --git a/src/p_spec.c b/src/p_spec.c
index e37fc6a0fd..a02fc37262 100644
--- a/src/p_spec.c
+++ b/src/p_spec.c
@@ -5667,6 +5667,10 @@ static void P_AddFloatThinker(sector_t *sec, UINT16 tag, line_t *sourceline)
 	floater->sector = sec;
 	floater->tag = (INT16)tag;
 	floater->sourceline = sourceline;
+
+	// interpolation
+	R_CreateInterpolator_SectorPlane(&floater->thinker, sec, false);
+	R_CreateInterpolator_SectorPlane(&floater->thinker, sec, true);
 }
 
 /**
-- 
GitLab