Merge branch 'write-thingies' into 'next'

The lump is not needed for P_WriteThings

See merge request STJr/SRB2!1231
This commit is contained in:
James R 2020-11-08 20:35:51 -05:00
commit bbd003976b
3 changed files with 3 additions and 8 deletions

View file

@ -1435,7 +1435,7 @@ void Command_Writethings_f(void)
REQUIRE_SINGLEPLAYER; REQUIRE_SINGLEPLAYER;
REQUIRE_OBJECTPLACE; REQUIRE_OBJECTPLACE;
P_WriteThings(W_GetNumForName(G_BuildMapName(gamemap)) + ML_THINGS); P_WriteThings();
} }
void Command_ObjectPlace_f(void) void Command_ObjectPlace_f(void)

View file

@ -904,16 +904,13 @@ static void P_SpawnMapThings(boolean spawnemblems)
} }
// Experimental groovy write function! // Experimental groovy write function!
void P_WriteThings(lumpnum_t lumpnum) void P_WriteThings(void)
{ {
size_t i, length; size_t i, length;
mapthing_t *mt; mapthing_t *mt;
UINT8 *data;
UINT8 *savebuffer, *savebuf_p; UINT8 *savebuffer, *savebuf_p;
INT16 temp; INT16 temp;
data = W_CacheLumpNum(lumpnum, PU_LEVEL);
savebuf_p = savebuffer = (UINT8 *)malloc(nummapthings * sizeof (mapthing_t)); savebuf_p = savebuffer = (UINT8 *)malloc(nummapthings * sizeof (mapthing_t));
if (!savebuf_p) if (!savebuf_p)
@ -935,8 +932,6 @@ void P_WriteThings(lumpnum_t lumpnum)
WRITEUINT16(savebuf_p, mt->options); WRITEUINT16(savebuf_p, mt->options);
} }
Z_Free(data);
length = savebuf_p - savebuffer; length = savebuf_p - savebuffer;
FIL_WriteFile(va("newthings%d.lmp", gamemap), savebuffer, length); FIL_WriteFile(va("newthings%d.lmp", gamemap), savebuffer, length);

View file

@ -105,7 +105,7 @@ boolean P_AddWadFile(const char *wadfilename);
boolean P_RunSOC(const char *socfilename); boolean P_RunSOC(const char *socfilename);
void P_LoadSoundsRange(UINT16 wadnum, UINT16 first, UINT16 num); void P_LoadSoundsRange(UINT16 wadnum, UINT16 first, UINT16 num);
void P_LoadMusicsRange(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); size_t P_PrecacheLevelFlats(void);
void P_AllocMapHeader(INT16 i); void P_AllocMapHeader(INT16 i);