"Loading SOC from" console message now also displays the name of the SOC_ lump

This commit is contained in:
Monster Iestyn 2016-03-03 18:31:17 +00:00
parent 18688f476f
commit 4f9bb15e4d

View file

@ -32,6 +32,7 @@
#include "w_wad.h"
#include "z_zone.h"
#include "fastcmp.h"
#include "i_video.h" // rendermode
#include "d_netfil.h"
@ -151,8 +152,16 @@ static inline void W_LoadDehackedLumps(UINT16 wadnum)
lumpinfo_t *lump_p = wadfiles[wadnum]->lumpinfo;
for (lump = 0; lump < wadfiles[wadnum]->numlumps; lump++, lump_p++)
if (memcmp(lump_p->name,"SOC_",4)==0) // Check for generic SOC lump
{
CONS_Printf(M_GetText("Loading SOC from %s\n"), wadfiles[wadnum]->filename);
{ // shameless copy+paste of code from LUA_LoadLump
char *name = malloc(strlen(wadfiles[wadnum]->filename)+10);
strcpy(name, wadfiles[wadnum]->filename);
if (!fasticmp(&name[strlen(name) - 4], ".soc")) {
// If it's not a .soc file, copy the lump name in too.
name[strlen(wadfiles[wadnum]->filename)] = '|';
M_Memcpy(name+strlen(wadfiles[wadnum]->filename)+1, lump_p->name, 8);
name[strlen(wadfiles[wadnum]->filename)+9] = '\0';
}
CONS_Printf(M_GetText("Loading SOC from %s\n"), name);
DEH_LoadDehackedLumpPwad(wadnum, lump);
}
else if (memcmp(lump_p->name,"MAINCFG",8)==0) // Check for MAINCFG