From 4f9bb15e4db743221622b421a5ee7828229e9917 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 3 Mar 2016 18:31:17 +0000 Subject: [PATCH] "Loading SOC from" console message now also displays the name of the SOC_ lump --- src/w_wad.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/w_wad.c b/src/w_wad.c index dc994e848..132df8fcb 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -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