diff --git a/src/r_data.c b/src/r_data.c
index ebb73cd428260efa174d1dfe2d8514f787a3b001..9f80e257b417799d06ac65fa2b7b4ab568a39203 100644
--- a/src/r_data.c
+++ b/src/r_data.c
@@ -1042,10 +1042,10 @@ void R_LoadTextures(void)
 
 	for (i = 0, w = 0; w < numwadfiles; w++)
 	{
-		i = Rloadtextures(i, w);
 #ifdef WALLFLATS
 		i = Rloadflats(i, w);
 #endif
+		i = Rloadtextures(i, w);
 	}
 
 #ifdef HWRENDER