diff --git a/src/p_slopes.c b/src/p_slopes.c
index 8e646e7306a207fa4a5c1f19b295d2bc4e302e87..19d0bbbb70aa865185b1d116de409e970baca7e3 100644
--- a/src/p_slopes.c
+++ b/src/p_slopes.c
@@ -602,7 +602,7 @@ void P_CopySectorSlope(line_t *line)
 
 	// if this is an FOF control sector, make sure any target sectors also are marked as having slopes
 	if (fsec->numattached)
-		for (i = 0; i < fsec->numattached; i++)
+		for (i = 0; i < (int)fsec->numattached; i++)
 			sectors[fsec->attached[i]].hasslope = true;
 
 	line->special = 0; // Linedef was use to set slopes, it finished its job, so now make it a normal linedef