Separate P_LoadThings into two functions to make the next commit cleaner

This commit is contained in:
RedEnchilada 2015-08-03 19:27:10 -05:00
parent 14ea936f74
commit c7b6cd705f

View file

@ -850,7 +850,7 @@ void P_ScanThings(INT16 mapnum, INT16 wadnum, INT16 lumpnum)
// //
// P_LoadThings // P_LoadThings
// //
static void P_LoadThings(lumpnum_t lumpnum) static void P_PrepareThings(lumpnum_t lumpnum)
{ {
size_t i; size_t i;
mapthing_t *mt; mapthing_t *mt;
@ -888,6 +888,15 @@ static void P_LoadThings(lumpnum_t lumpnum)
} }
Z_Free(datastart); Z_Free(datastart);
}
static void P_LoadThings(void)
{
size_t i;
mapthing_t *mt;
// Loading the things lump itself into memory is now handled in P_PrepareThings, above
mt = mapthings; mt = mapthings;
numhuntemeralds = 0; numhuntemeralds = 0;
for (i = 0; i < nummapthings; i++, mt++) for (i = 0; i < nummapthings; i++, mt++)
@ -2123,7 +2132,8 @@ void P_LoadThingsOnly(void)
P_LevelInitStuff(); P_LevelInitStuff();
P_LoadThings(lastloadedmaplumpnum + ML_THINGS); P_PrepareThings(lastloadedmaplumpnum + ML_THINGS);
P_LoadThings();
P_SpawnSecretItems(true); P_SpawnSecretItems(true);
} }
@ -2540,11 +2550,13 @@ boolean P_SetupLevel(boolean skipprecip)
P_MapStart(); P_MapStart();
P_PrepareThings(lastloadedmaplumpnum + ML_THINGS);
#ifdef ESLOPE #ifdef ESLOPE
P_ResetDynamicSlopes(); P_ResetDynamicSlopes();
#endif #endif
P_LoadThings(lastloadedmaplumpnum + ML_THINGS); P_LoadThings();
P_SpawnSecretItems(loademblems); P_SpawnSecretItems(loademblems);