From b564a169d80a0ff6db33de6e03f505803d8f05cf Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 17 Jun 2015 21:00:10 +0100 Subject: [PATCH 01/13] Starting work for getting sector.lines in Lua: it WORKS at the least, but I have no way to determine the size of the array itself as of yet --- src/lua_libs.h | 1 + src/lua_maplib.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/src/lua_libs.h b/src/lua_libs.h index d19ad8857..25552eacb 100644 --- a/src/lua_libs.h +++ b/src/lua_libs.h @@ -42,6 +42,7 @@ extern lua_State *gL; #define META_CVAR "CONSVAR_T*" +#define META_SECTORLINES "SECTOR_T*LINES" #define META_SIDENUM "LINE_T*SIDENUM" #define META_HUDINFO "HUDINFO_T*" diff --git a/src/lua_maplib.c b/src/lua_maplib.c index e5cc30c12..40acc6dff 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -37,6 +37,7 @@ enum sector_e { sector_thinglist, sector_heightsec, sector_camsec, + sector_lines, sector_ffloors }; @@ -52,6 +53,7 @@ static const char *const sector_opt[] = { "thinglist", "heightsec", "camsec", + "lines", "ffloors", NULL}; @@ -260,6 +262,49 @@ static int sector_iterate(lua_State *L) return 3; } +// sector.lines, i -> sector.lines[i] +// sector.lines.valid, for validity checking +static int sectorlines_get(lua_State *L) +{ + line_t **seclines = *((line_t ***)luaL_checkudata(L, 1, META_SECTORLINES)); + size_t i; + //size_t numoflines; + lua_settop(L, 2); + if (!lua_isnumber(L, 2)) + { + int field = luaL_checkoption(L, 2, NULL, valid_opt); + if (!seclines) + { + if (field == 0) { + lua_pushboolean(L, 0); + return 1; + } + return luaL_error(L, "accessed sector_t doesn't exist anymore."); + } else if (field == 0) { + lua_pushboolean(L, 1); + return 1; + } + } + + /* \TODO: figure out how to find size of seclines array, rather than the size of a pointer! + Testing for sectors[0].lines in GFZ1 with a test Lua script: + sizeof(seclines) returns 4 + sizeof(*seclines) returns 4 + sizeof(**seclines) returns 84, presumably the size of line_t + You can probably see why I haven't been successful yet, hopefully + //CONS_Printf("sizeof(seclines): %d\n", sizeof(seclines)); + //CONS_Printf("sizeof(seclines[0]): %d\n", sizeof(seclines[0]));*/ + + /*numoflines = sizeof(seclines) / sizeof(seclines[0]); + if (!numoflines) + return luaL_error(L, "no lines found!");*/ + i = (size_t)lua_tointeger(L, 2); + /*if (i > numoflines) + return 0;*/ + LUA_PushUserdata(L, seclines[i], META_LINE); + return 1; +} + static int sector_get(lua_State *L) { sector_t *sector = *((sector_t **)luaL_checkudata(L, 1, META_SECTOR)); @@ -325,6 +370,9 @@ static int sector_get(lua_State *L) return 0; LUA_PushUserdata(L, §ors[sector->camsec], META_SECTOR); return 1; + case sector_lines: // lines + LUA_PushUserdata(L, sector->lines, META_SECTORLINES); + return 1; case sector_ffloors: // ffloors lua_pushcfunction(L, lib_iterateSectorFFloors); LUA_PushUserdata(L, sector->ffloors, META_FFLOOR); @@ -1178,6 +1226,11 @@ static int mapheaderinfo_get(lua_State *L) int LUA_MapLib(lua_State *L) { + luaL_newmetatable(L, META_SECTORLINES); + lua_pushcfunction(L, sectorlines_get); + lua_setfield(L, -2, "__index"); + lua_pop(L, 1); + luaL_newmetatable(L, META_SECTOR); lua_pushcfunction(L, sector_get); lua_setfield(L, -2, "__index"); From af3c4755dc1c26c003d595474799560eba83b964 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 17 Jan 2016 19:43:26 +0000 Subject: [PATCH 02/13] All lumps with the "SOC_" prefix in their names are now read as SOCs. --- src/w_wad.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/w_wad.c b/src/w_wad.c index 9d6a11fb5..39bde4bb1 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -147,6 +147,16 @@ static inline void W_LoadDehackedLumps(UINT16 wadnum) } #endif + { + 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) + { + CONS_Printf(M_GetText("Loading SOC from %s\n"), wadfiles[wadnum]->filename); + DEH_LoadDehackedLumpPwad(wadnum, lump); + } + } + // Check for MAINCFG for (lump = 0;lump != INT16_MAX;lump++) { From 79e3e2351d17f4f223d75295635122257219242d Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 20 Jan 2016 14:56:52 +0000 Subject: [PATCH 03/13] Finally bothered to add in a method to obtain sector.lines' size internally to prevent going out of bounds. Admittedly I knew of this particular method from the start but wanted to avoid it in favour of a less-hacky looking method of getting sector.lines' size ...but there was none to be found at all. --- src/lua_maplib.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 1307540fb..77651b209 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -268,7 +268,7 @@ static int sectorlines_get(lua_State *L) { line_t **seclines = *((line_t ***)luaL_checkudata(L, 1, META_SECTORLINES)); size_t i; - //size_t numoflines; + size_t numoflines = 0; lua_settop(L, 2); if (!lua_isnumber(L, 2)) { @@ -286,21 +286,22 @@ static int sectorlines_get(lua_State *L) } } - /* \TODO: figure out how to find size of seclines array, rather than the size of a pointer! - Testing for sectors[0].lines in GFZ1 with a test Lua script: - sizeof(seclines) returns 4 - sizeof(*seclines) returns 4 - sizeof(**seclines) returns 84, presumably the size of line_t - You can probably see why I haven't been successful yet, hopefully - //CONS_Printf("sizeof(seclines): %d\n", sizeof(seclines)); - //CONS_Printf("sizeof(seclines[0]): %d\n", sizeof(seclines[0]));*/ + // check first linedef to figure which of its sectors owns this sector->lines pointer + // then check that sector's linecount to get a maximum index + //if (!seclines[0]) + //return luaL_error(L, "no lines found!"); // no first linedef????? + if (seclines[0]->frontsector->lines == seclines) + numoflines = seclines[0]->frontsector->linecount; + else if (seclines[0]->backsector && seclines[0]->backsector->lines == seclines) // check backsector exists first + numoflines = seclines[0]->backsector->linecount; + //if neither sector has it then ??? - /*numoflines = sizeof(seclines) / sizeof(seclines[0]); if (!numoflines) - return luaL_error(L, "no lines found!");*/ + return luaL_error(L, "no lines found!"); + i = (size_t)lua_tointeger(L, 2); - /*if (i > numoflines) - return 0;*/ + if (i >= numoflines) + return 0; LUA_PushUserdata(L, seclines[i], META_LINE); return 1; } From 5abdb08a25da14e1378adb937a4418e92dfcc609 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 20 Jan 2016 16:03:17 +0000 Subject: [PATCH 04/13] #sector.lines now returns the number of linedefs in the sector --- src/lua_maplib.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 77651b209..d585c479f 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -306,6 +306,23 @@ static int sectorlines_get(lua_State *L) return 1; } +static int sectorlines_num(lua_State *L) +{ + line_t **seclines = *((line_t ***)luaL_checkudata(L, 1, META_SECTORLINES)); + size_t numoflines = 0; + // check first linedef to figure which of its sectors owns this sector->lines pointer + // then check that sector's linecount to get a maximum index + //if (!seclines[0]) + //return luaL_error(L, "no lines found!"); // no first linedef????? + if (seclines[0]->frontsector->lines == seclines) + numoflines = seclines[0]->frontsector->linecount; + else if (seclines[0]->backsector && seclines[0]->backsector->lines == seclines) // check backsector exists first + numoflines = seclines[0]->backsector->linecount; + //if neither sector has it then ??? + lua_pushinteger(L, numoflines); + return 1; +} + static int sector_get(lua_State *L) { sector_t *sector = *((sector_t **)luaL_checkudata(L, 1, META_SECTOR)); @@ -1282,6 +1299,9 @@ int LUA_MapLib(lua_State *L) luaL_newmetatable(L, META_SECTORLINES); lua_pushcfunction(L, sectorlines_get); lua_setfield(L, -2, "__index"); + + lua_pushcfunction(L, sectorlines_num); + lua_setfield(L, -2, "__len"); lua_pop(L, 1); luaL_newmetatable(L, META_SECTOR); From cd198d6809d171ac242b0bfe7db768a04e135003 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 30 Jan 2016 17:19:05 +0000 Subject: [PATCH 05/13] merge SOC_****, MAINCFG and OBJCTCFG searches into one big search for any of them This makes it so that it doesn't matter what order you place SOC lumps within a WAD... relative to other SOC lumps at least, anyway --- src/w_wad.c | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/src/w_wad.c b/src/w_wad.c index 39bde4bb1..dc994e848 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -150,31 +150,21 @@ 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) + 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); DEH_LoadDehackedLumpPwad(wadnum, lump); } - } - - // Check for MAINCFG - for (lump = 0;lump != INT16_MAX;lump++) - { - lump = W_CheckNumForNamePwad("MAINCFG", wadnum, lump); - if (lump == INT16_MAX) - break; - CONS_Printf(M_GetText("Loading main config from %s\n"), wadfiles[wadnum]->filename); - DEH_LoadDehackedLumpPwad(wadnum, lump); - } - - // Check for OBJCTCFG - for (lump = 0;lump < INT16_MAX;lump++) - { - lump = W_CheckNumForNamePwad("OBJCTCFG", wadnum, lump); - if (lump == INT16_MAX) - break; - CONS_Printf(M_GetText("Loading object config from %s\n"), wadfiles[wadnum]->filename); - DEH_LoadDehackedLumpPwad(wadnum, lump); + else if (memcmp(lump_p->name,"MAINCFG",8)==0) // Check for MAINCFG + { + CONS_Printf(M_GetText("Loading main config from %s\n"), wadfiles[wadnum]->filename); + DEH_LoadDehackedLumpPwad(wadnum, lump); + } + else if (memcmp(lump_p->name,"OBJCTCFG",8)==0) // Check for OBJCTCFG + { + CONS_Printf(M_GetText("Loading object config from %s\n"), wadfiles[wadnum]->filename); + DEH_LoadDehackedLumpPwad(wadnum, lump); + } } #ifdef SCANTHINGS From dafe0ccd11b321546dbf5728d510c98f51db2ce0 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 31 Jan 2016 21:53:14 +0000 Subject: [PATCH 06/13] Added v.width(), v.height() and v.renderer() to Lua's drawer/video library --- src/lua_hudlib.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 5a83d95b5..fa15b9be7 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -16,7 +16,9 @@ #include "r_local.h" #include "st_stuff.h" // hudinfo[] #include "g_game.h" +#include "i_video.h" // rendermode #include "p_local.h" // camera_t +#include "screen.h" // screen width/height #include "v_video.h" #include "w_wad.h" #include "z_zone.h" @@ -510,6 +512,30 @@ static int libd_getColormap(lua_State *L) return 1; } +static int libd_width(lua_State *L) +{ + HUDONLY + lua_pushinteger(L, vid.width); // push screen width + return 1; +} + +static int libd_height(lua_State *L) +{ + HUDONLY + lua_pushinteger(L, vid.height); // push screen height + return 1; +} + +static int libd_renderer(lua_State *L) +{ + HUDONLY + if (rendermode == render_opengl) // OpenGL renderer + lua_pushliteral(L, "opengl"); + else // Software renderer + lua_pushliteral(L, "software"); + return 1; +} + static luaL_Reg lib_draw[] = { {"patchExists", libd_patchExists}, {"cachePatch", libd_cachePatch}, @@ -521,6 +547,9 @@ static luaL_Reg lib_draw[] = { {"drawString", libd_drawString}, {"stringWidth", libd_stringWidth}, {"getColormap", libd_getColormap}, + {"width", libd_width}, + {"height", libd_height}, + {"renderer", libd_renderer}, {NULL, NULL} }; From 04528eb3e64e931588e33c48d58a2c3201875e00 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 31 Jan 2016 22:15:17 +0000 Subject: [PATCH 07/13] MonsterIestyn: what about render_none? --- src/lua_hudlib.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index fa15b9be7..0ba7b3d25 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -529,10 +529,11 @@ static int libd_height(lua_State *L) static int libd_renderer(lua_State *L) { HUDONLY - if (rendermode == render_opengl) // OpenGL renderer - lua_pushliteral(L, "opengl"); - else // Software renderer - lua_pushliteral(L, "software"); + switch (rendermode) { + case render_opengl: lua_pushliteral(L, "opengl"); break; // OpenGL renderer + case render_soft: lua_pushliteral(L, "software"); break; // Software renderer + default: lua_pushliteral(L, "none"); break; // render_none (for dedicated), in case there's any reason this should be run + } return 1; } From d1b89c9320f98cfe2bf514fe7dbd1890c4f21403 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 31 Jan 2016 22:52:02 +0000 Subject: [PATCH 08/13] Quick fix for another drawer lib function while I'm here, cough --- src/lua_hudlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 0ba7b3d25..325f00b01 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -488,7 +488,7 @@ static int libd_getColormap(lua_State *L) INT32 skinnum = TC_DEFAULT; skincolors_t color = luaL_optinteger(L, 2, 0); UINT8* colormap = NULL; - //HUDSAFE + HUDONLY if (lua_isnoneornil(L, 1)) ; // defaults to TC_DEFAULT else if (lua_type(L, 1) == LUA_TNUMBER) // skin number From db3797fd35da9dfde3dcef754b48ac47d9ea602d Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Sun, 14 Feb 2016 05:19:40 -0600 Subject: [PATCH 09/13] Add PlayerSpawn hook --- src/lua_hook.h | 2 ++ src/lua_hooklib.c | 1 + src/p_mobj.c | 6 ++++++ 3 files changed, 9 insertions(+) diff --git a/src/lua_hook.h b/src/lua_hook.h index da2dcdc38..f3af7f304 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -42,6 +42,7 @@ enum hook { hook_LinedefExecute, hook_PlayerMsg, hook_HurtMsg, + hook_PlayerSpawn, hook_MAX // last hook }; @@ -75,5 +76,6 @@ boolean LUAh_BotAI(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd); // Hook for B_B boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector); // Hook for linedef executors boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg); // Hook for chat messages boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source); // Hook for hurt messages +#define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for P_SpawnPlayer #endif diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 0415d23e6..dfd6d703c 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -53,6 +53,7 @@ const char *const hookNames[hook_MAX+1] = { "LinedefExecute", "PlayerMsg", "HurtMsg", + "PlayerSpawn", NULL }; diff --git a/src/p_mobj.c b/src/p_mobj.c index 25ae8815a..4916dbfdf 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8294,6 +8294,12 @@ void P_SpawnPlayer(INT32 playernum) // Spawn with a pity shield if necessary. P_DoPityCheck(p); + +#ifdef HAVE_BLUA + if (LUAh_PlayerSpawn(p)) // Lua hook for player spawning :) + ; +#endif + } void P_AfterPlayerSpawn(INT32 playernum) From 000ec9ac67c47c1c16489f35987fe2c87caaab81 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Sun, 14 Feb 2016 15:22:13 -0600 Subject: [PATCH 10/13] Call LUAh_PlayerSpawn instead of checking for it --- src/p_mobj.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 4916dbfdf..367a3a7d0 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8296,8 +8296,7 @@ void P_SpawnPlayer(INT32 playernum) P_DoPityCheck(p); #ifdef HAVE_BLUA - if (LUAh_PlayerSpawn(p)) // Lua hook for player spawning :) - ; + LUAh_PlayerSpawn(p); // Lua hook for player spawning :) #endif } From 5c9aaf2fe4ae3d93dfe50028634e0b70d4ac598f Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Thu, 25 Feb 2016 22:28:19 -0600 Subject: [PATCH 11/13] Move hook into G_SpawnPlayer --- src/g_game.c | 6 ++++++ src/lua_hook.h | 2 +- src/p_mobj.c | 5 ----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 72cfe4a57..3329e8eff 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2328,6 +2328,12 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost) } } P_MovePlayerToSpawn(playernum, spawnpoint); + +#ifdef HAVE_BLUA + player_t *p = &players[playernum]; + LUAh_PlayerSpawn(p); // Lua hook for player spawning :) +#endif + } mapthing_t *G_FindCTFStart(INT32 playernum) diff --git a/src/lua_hook.h b/src/lua_hook.h index f3af7f304..4eb083780 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -76,6 +76,6 @@ boolean LUAh_BotAI(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd); // Hook for B_B boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector); // Hook for linedef executors boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg); // Hook for chat messages boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source); // Hook for hurt messages -#define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for P_SpawnPlayer +#define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for G_SpawnPlayer #endif diff --git a/src/p_mobj.c b/src/p_mobj.c index 367a3a7d0..25ae8815a 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8294,11 +8294,6 @@ void P_SpawnPlayer(INT32 playernum) // Spawn with a pity shield if necessary. P_DoPityCheck(p); - -#ifdef HAVE_BLUA - LUAh_PlayerSpawn(p); // Lua hook for player spawning :) -#endif - } void P_AfterPlayerSpawn(INT32 playernum) From 8f0abb267edd493b58e875a08083af9c36ea3870 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Thu, 25 Feb 2016 22:47:52 -0600 Subject: [PATCH 12/13] Don't mix declarations and code --- src/g_game.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 3329e8eff..219b276ec 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2330,8 +2330,7 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost) P_MovePlayerToSpawn(playernum, spawnpoint); #ifdef HAVE_BLUA - player_t *p = &players[playernum]; - LUAh_PlayerSpawn(p); // Lua hook for player spawning :) + LUAh_PlayerSpawn(&players[playernum]); // Lua hook for player spawning :) #endif } From 4f9bb15e4db743221622b421a5ee7828229e9917 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 3 Mar 2016 18:31:17 +0000 Subject: [PATCH 13/13] "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