diff --git a/src/m_cheat.c b/src/m_cheat.c
index 8e9cd9f51d9020e63b47f7f2ac66274c22cc9d13..365bcee8c6849b4e872e78bacf90f19f48726202 100644
--- a/src/m_cheat.c
+++ b/src/m_cheat.c
@@ -1435,7 +1435,7 @@ void Command_Writethings_f(void)
 	REQUIRE_SINGLEPLAYER;
 	REQUIRE_OBJECTPLACE;
 
-	P_WriteThings(W_GetNumForName(G_BuildMapName(gamemap)) + ML_THINGS);
+	P_WriteThings();
 }
 
 void Command_ObjectPlace_f(void)
diff --git a/src/p_setup.c b/src/p_setup.c
index c8fad7bd3a18077f09895cce4ddf2754af60ea24..23a73b1f51b1b28bd49f0a2cffeb4e8544c19bb1 100644
--- a/src/p_setup.c
+++ b/src/p_setup.c
@@ -904,16 +904,13 @@ static void P_SpawnMapThings(boolean spawnemblems)
 }
 
 // Experimental groovy write function!
-void P_WriteThings(lumpnum_t lumpnum)
+void P_WriteThings(void)
 {
 	size_t i, length;
 	mapthing_t *mt;
-	UINT8 *data;
 	UINT8 *savebuffer, *savebuf_p;
 	INT16 temp;
 
-	data = W_CacheLumpNum(lumpnum, PU_LEVEL);
-
 	savebuf_p = savebuffer = (UINT8 *)malloc(nummapthings * sizeof (mapthing_t));
 
 	if (!savebuf_p)
@@ -935,8 +932,6 @@ void P_WriteThings(lumpnum_t lumpnum)
 		WRITEUINT16(savebuf_p, mt->options);
 	}
 
-	Z_Free(data);
-
 	length = savebuf_p - savebuffer;
 
 	FIL_WriteFile(va("newthings%d.lmp", gamemap), savebuffer, length);
diff --git a/src/p_setup.h b/src/p_setup.h
index ea5ff6454cab5ac98ea69c7235285ef41c7bae5d..c82f93351e48a2a66bae43dfa1781d5a45265b32 100644
--- a/src/p_setup.h
+++ b/src/p_setup.h
@@ -105,7 +105,7 @@ boolean P_AddWadFile(const char *wadfilename);
 boolean P_RunSOC(const char *socfilename);
 void P_LoadSoundsRange(UINT16 wadnum, UINT16 first, UINT16 num);
 void P_LoadMusicsRange(UINT16 wadnum, UINT16 first, UINT16 num);
-void P_WriteThings(lumpnum_t lump);
+void P_WriteThings(void);
 size_t P_PrecacheLevelFlats(void);
 void P_AllocMapHeader(INT16 i);