From 0e38208620d19ec2ab690740438ac2fc7862a49e Mon Sep 17 00:00:00 2001
From: Eidolon <furyhunter600@gmail.com>
Date: Mon, 11 Apr 2022 18:49:50 -0500
Subject: [PATCH] Remove unnecessary precipmobj thinker hack

---
 src/hardware/hw_main.c | 10 ----------
 src/p_mobj.c           |  7 +++----
 src/p_mobj.h           |  2 --
 src/r_things.c         | 13 +------------
 4 files changed, 4 insertions(+), 28 deletions(-)

diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c
index 57d329f66b..7aefc91875 100644
--- a/src/hardware/hw_main.c
+++ b/src/hardware/hw_main.c
@@ -5572,16 +5572,6 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
 	vis->gz = vis->gzt - FIXED_TO_FLOAT(spritecachedinfo[lumpoff].height);
 
 	vis->precip = true;
-
-	// okay... this is a hack, but weather isn't networked, so it should be ok
-	if (!(thing->precipflags & PCF_THUNK))
-	{
-		if (thing->precipflags & PCF_RAIN)
-			P_RainThinker(thing);
-		else
-			P_SnowThinker(thing);
-		thing->precipflags |= PCF_THUNK;
-	}
 }
 #endif
 
diff --git a/src/p_mobj.c b/src/p_mobj.c
index 719858802b..146ec3dacc 100644
--- a/src/p_mobj.c
+++ b/src/p_mobj.c
@@ -4021,8 +4021,7 @@ void P_RecalcPrecipInSector(sector_t *sector)
 //
 void P_NullPrecipThinker(precipmobj_t *mobj)
 {
-	//(void)mobj;
-	mobj->precipflags &= ~PCF_THUNK;
+	(void)mobj;
 }
 
 void P_SnowThinker(precipmobj_t *mobj)
@@ -10950,14 +10949,14 @@ static inline precipmobj_t *P_SpawnRainMobj(fixed_t x, fixed_t y, fixed_t z, mob
 {
 	precipmobj_t *mo = P_SpawnPrecipMobj(x,y,z,type);
 	mo->precipflags |= PCF_RAIN;
-	//mo->thinker.function.acp1 = (actionf_p1)P_RainThinker;
+	mo->thinker.function.acp1 = (actionf_p1)P_RainThinker;
 	return mo;
 }
 
 static inline precipmobj_t *P_SpawnSnowMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
 {
 	precipmobj_t *mo = P_SpawnPrecipMobj(x,y,z,type);
-	//mo->thinker.function.acp1 = (actionf_p1)P_SnowThinker;
+	mo->thinker.function.acp1 = (actionf_p1)P_SnowThinker;
 	return mo;
 }
 
diff --git a/src/p_mobj.h b/src/p_mobj.h
index 998baa19e8..702fd40474 100644
--- a/src/p_mobj.h
+++ b/src/p_mobj.h
@@ -269,8 +269,6 @@ typedef enum {
 	PCF_MOVINGFOF = 8,
 	// Is rain.
 	PCF_RAIN = 16,
-	// Ran the thinker this tic.
-	PCF_THUNK = 32,
 } precipflag_t;
 
 // Map Object definition.
diff --git a/src/r_things.c b/src/r_things.c
index b3d5bc2ed8..19961c51b4 100644
--- a/src/r_things.c
+++ b/src/r_things.c
@@ -2258,7 +2258,7 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing)
 	if (thing->subsector->sector->cullheight)
 	{
 		if (R_DoCulling(thing->subsector->sector->cullheight, viewsector->cullheight, viewz, gz, gzt))
-			goto weatherthink;
+			return;
 	}
 
 	// store information in a vissprite
@@ -2312,17 +2312,6 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing)
 
 	// Fullbright
 	vis->colormap = colormaps;
-
-weatherthink:
-	// okay... this is a hack, but weather isn't networked, so it should be ok
-	if (!(thing->precipflags & PCF_THUNK))
-	{
-		if (thing->precipflags & PCF_RAIN)
-			P_RainThinker(thing);
-		else
-			P_SnowThinker(thing);
-		thing->precipflags |= PCF_THUNK;
-	}
 }
 
 // R_AddSprites
-- 
GitLab