From c026b707cea12bb1c46ca3ea8af2b888dae6fe57 Mon Sep 17 00:00:00 2001
From: MascaraSnake <jonassauer27@gmail.com>
Date: Sun, 26 Apr 2020 18:54:03 +0200
Subject: [PATCH] Make new thinker loading functions set floordata/ceilingdata
 where necessary

---
 src/p_saveg.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/src/p_saveg.c b/src/p_saveg.c
index f6e31fc3a4..c5724c15ca 100644
--- a/src/p_saveg.c
+++ b/src/p_saveg.c
@@ -2892,6 +2892,10 @@ static thinker_t* LoadBounceCheeseThinker(actionf_p1 thinker)
 	ht->floorwasheight = READFIXED(save_p);
 	ht->ceilingwasheight = READFIXED(save_p);
 	ht->low = READCHAR(save_p);
+
+	if (ht->sector)
+		ht->sector->ceilingdata = ht;
+
 	return &ht->thinker;
 }
 
@@ -2909,6 +2913,13 @@ static thinker_t* LoadContinuousFallThinker(actionf_p1 thinker)
 	ht->floorstartheight = READFIXED(save_p);
 	ht->ceilingstartheight = READFIXED(save_p);
 	ht->destheight = READFIXED(save_p);
+
+	if (ht->sector)
+	{
+		ht->sector->ceilingdata = ht;
+		ht->sector->floordata = ht;
+	}
+
 	return &ht->thinker;
 }
 
@@ -2926,6 +2937,13 @@ static thinker_t* LoadMarioBlockThinker(actionf_p1 thinker)
 	ht->floorstartheight = READFIXED(save_p);
 	ht->ceilingstartheight = READFIXED(save_p);
 	ht->tag = READINT16(save_p);
+
+	if (ht->sector)
+	{
+		ht->sector->ceilingdata = ht;
+		ht->sector->floordata = ht;
+	}
+
 	return &ht->thinker;
 }
 
@@ -2960,6 +2978,13 @@ static thinker_t* LoadThwompThinker(actionf_p1 thinker)
 	ht->delay = READINT32(save_p);
 	ht->tag = READINT16(save_p);
 	ht->sound = READUINT16(save_p);
+
+	if (ht->sector)
+	{
+		ht->sector->ceilingdata = ht;
+		ht->sector->floordata = ht;
+	}
+
 	return &ht->thinker;
 }
 
-- 
GitLab