diff --git a/src/p_spec.c b/src/p_spec.c
index 8e51f788c8d99959c07eb33b1bce6c48284f9a7e..8ae0ec125495645a9117316c43a6d48dfcc174fc 100644
--- a/src/p_spec.c
+++ b/src/p_spec.c
@@ -1981,6 +1981,22 @@ void P_LinedefExecute(INT16 tag, mobj_t *actor, sector_t *caller)
 	}
 }
 
+static boolean is_rain_type (INT32 weathernum)
+{
+	switch (weathernum)
+	{
+		case PRECIP_SNOW:
+		case PRECIP_RAIN:
+		case PRECIP_STORM:
+		case PRECIP_STORM_NOSTRIKES:
+		case PRECIP_BLANK:
+			return true;
+
+		default:
+			return false;
+	}
+}
+
 //
 // P_SwitchWeather
 //
@@ -1989,12 +2005,12 @@ void P_LinedefExecute(INT16 tag, mobj_t *actor, sector_t *caller)
 void P_SwitchWeather(INT32 weathernum)
 {
 	boolean purge = true;
-	boolean raintype = (PRECIP_SNOW || PRECIP_RAIN || PRECIP_STORM || PRECIP_STORM_NOSTRIKES || PRECIP_BLANK);
 
 	if (weathernum == curWeather)
 		return;
 
-	if (weathernum == raintype && curWeather == raintype)
+	if (is_rain_type(weathernum) &&
+			is_rain_type(curWeather))
 		purge = false;
 
 	if (purge)