From 7c67d32c6b8a2ead11117daf94afbe322f18be13 Mon Sep 17 00:00:00 2001 From: Radicalicious Date: Fri, 18 Jun 2021 00:51:36 -0400 Subject: [PATCH 01/23] Update deh_tables.c --- src/deh_tables.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/deh_tables.c b/src/deh_tables.c index 5733d9b0e..df993fee8 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -361,8 +361,9 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi "S_XDEATHSTATE", "S_RAISESTATE", - // Thok + // Thok effect and spin trail "S_THOK", + "S_THOKEFFECT", // Player "S_PLAY_STND", @@ -3490,7 +3491,8 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t "MT_NULL", "MT_UNKNOWN", - "MT_THOK", // Thok! mobj + "MT_THOK", // Spin trail mobj + "MT_THOKEFFECT", // Thok boom effect "MT_PLAYER", "MT_TAILSOVERLAY", // c: "MT_METALJETFUME", From a9a5d5fa026782197e878d8cd1e178d44eb4f696 Mon Sep 17 00:00:00 2001 From: Radicalicious Date: Fri, 18 Jun 2021 00:53:29 -0400 Subject: [PATCH 02/23] Update info.h --- src/info.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/info.h b/src/info.h index 604922beb..34b56b2cc 100644 --- a/src/info.h +++ b/src/info.h @@ -567,7 +567,8 @@ typedef enum sprite SPR_NULL, // invisible object SPR_UNKN, - SPR_THOK, // Thok! mobj + SPR_THOK, // Spin trail mobj + SPR_THKE, // Thok boom effect SPR_PLAY, // Enemies @@ -1163,8 +1164,9 @@ typedef enum state S_XDEATHSTATE, S_RAISESTATE, - // Thok + // Thok boom effect and spin trail S_THOK, + S_THOKEFFECT, // Player S_PLAY_STND, @@ -4312,7 +4314,8 @@ typedef enum mobj_type MT_NULL, MT_UNKNOWN, - MT_THOK, // Thok! mobj + MT_THOK, // Spin trail mobj + MT_THOKEFFECT, // Thok boom effect MT_PLAYER, MT_TAILSOVERLAY, // c: MT_METALJETFUME, From 863dc6be38529326ab88580bf02a94a6482add46 Mon Sep 17 00:00:00 2001 From: Radicalicious Date: Fri, 18 Jun 2021 00:55:14 -0400 Subject: [PATCH 03/23] Update info.c --- src/info.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/info.c b/src/info.c index 29a79b1d6..351d1ea88 100644 --- a/src/info.c +++ b/src/info.c @@ -33,7 +33,8 @@ char sprnames[NUMSPRITES + 1][5] = "NULL", // invisible object "UNKN", - "THOK", // Thok! mobj + "THOK", // Spin trail mobj + "THKE", // Thok boom effect "PLAY", // Enemies @@ -697,8 +698,9 @@ state_t states[NUMSTATES] = {SPR_UNKN, FF_FULLBRIGHT, -1, {A_InfoState}, 5, 0, S_NULL}, // S_XDEATHSTATE {SPR_UNKN, FF_FULLBRIGHT, -1, {A_InfoState}, 6, 0, S_NULL}, // S_RAISESTATE - // Thok + // Spin trail and thok boom effect {SPR_THOK, FF_TRANS50, 8, {NULL}, 0, 0, S_NULL}, // S_THOK + {SPR_THKE, FF_TRANS50|FF_PAPERSPRITE, 8, {NULL}, 0, 0, S_NULL}, // S_THOKEFFECT // Player {SPR_PLAY, SPR2_STND|FF_ANIMATE, 105, {NULL}, 0, 7, S_PLAY_WAIT}, // S_PLAY_STND @@ -4011,6 +4013,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags S_NULL // raisestate }, + + { // MT_THOKEFFECT + -1, // doomednum + S_THOK, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 8, // speed + 32*FRACUNIT, // radius + 64*FRACUNIT, // height + 0, // display offset + 16, // mass + 0, // damage + sfx_None, // activesound + MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY, // flags + S_NULL // raisestate + }, { // MT_PLAYER -1, // doomednum From 87bcdb8643503f0ad765366223649517e1cbf7da Mon Sep 17 00:00:00 2001 From: Radicalicious Date: Fri, 18 Jun 2021 00:57:33 -0400 Subject: [PATCH 04/23] Update p_user.c --- src/p_user.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index c5f919c78..f920ba4a6 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2075,7 +2075,19 @@ void P_SpawnThokMobj(player_t *player) if (type == MT_GHOST) mobj = P_SpawnGhostMobj(player->mo); // virtually does everything here for us - else + else if (type == MT_THOKEFFECT) // Thok boom effect for Sonic + { + mobj = P_SpawnMobjFromMobj(player->mo, 0, 0, player->mo->scale * 24, type); + mobj->angle = player->mo->angle + ANGLE_90; + mobj->fuse = 7; + mobj->scale = FRACUNIT / 3; + mobj->destscale = 10*FRACUNIT; + mobj->colorized = true; + mobj->color = player->mo->color; + mobj->momx = -player->mo->momx / 2; + mobj->momy = -player->mo->momy / 2; + } + else // Normal thok object handling { if (player->mo->eflags & MFE_VERTICALFLIP) zheight = player->mo->z + player->mo->height + FixedDiv(P_GetPlayerHeight(player) - player->mo->height, 3*FRACUNIT) - FixedMul(mobjinfo[type].height, player->mo->scale); From 1160b97a41fd535c0d74918caff0f8a33cebaafc Mon Sep 17 00:00:00 2001 From: Radicalicious Date: Fri, 18 Jun 2021 01:08:41 -0400 Subject: [PATCH 05/23] Hopefully fix ghosts without fucking my next branch --- src/g_demo.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/g_demo.c b/src/g_demo.c index 9d3b86015..9f955f13b 100644 --- a/src/g_demo.c +++ b/src/g_demo.c @@ -784,6 +784,19 @@ void G_GhostTicker(void) mobj = P_SpawnGhostMobj(g->mo); // does a large portion of the work for us mobj->frame = (mobj->frame & ~FF_FRAMEMASK)|tr_trans60<mo, 0, 0, g->mo->scale * 24, type); + mobj->angle = g->mo->angle + ANGLE_90; + mobj->fuse = 7; + mobj->scale = FRACUNIT / 3; + mobj->destscale = 10*FRACUNIT; + mobj->colorized = true; + mobj->color = g->mo->color; + mobj->momx = -g->mo->momx / 2; + mobj->momy = -g->mo->momy / 2; + } + else { mobj = P_SpawnMobjFromMobj(g->mo, 0, 0, -FixedDiv(FixedMul(g->mo->info->height, g->mo->scale) - g->mo->height,3*FRACUNIT), MT_THOK); @@ -1074,6 +1087,18 @@ void G_ReadMetalTic(mobj_t *metal) { mobj = P_SpawnGhostMobj(metal); // does a large portion of the work for us } + else if (type == MT_THOKEFFECT) + { + mobj = P_SpawnMobjFromMobj(metal, 0, 0, metal->scale * 24, type); + mobj->angle = metal->angle + ANGLE_90; + mobj->fuse = 7; + mobj->scale = FRACUNIT / 3; + mobj->destscale = 10*FRACUNIT; + mobj->colorized = true; + mobj->color = metal->color; + mobj->momx = -metal->momx / 2; + mobj->momy = -metal->momy / 2; + } else { mobj = P_SpawnMobjFromMobj(metal, 0, 0, -FixedDiv(FixedMul(metal->info->height, metal->scale) - metal->height,3*FRACUNIT), MT_THOK); From 44bdfd8eafb466b710ed98dd4f71363798ce0395 Mon Sep 17 00:00:00 2001 From: Radicalicious Date: Fri, 18 Jun 2021 02:40:44 -0400 Subject: [PATCH 06/23] Update hw_light.c --- src/hardware/hw_light.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hardware/hw_light.c b/src/hardware/hw_light.c index 987d70c69..71c450d5b 100644 --- a/src/hardware/hw_light.c +++ b/src/hardware/hw_light.c @@ -138,6 +138,7 @@ light_t *t_lspr[NUMSPRITES] = &lspr[NOLIGHT], // SPR_UNKN &lspr[NOLIGHT], // SPR_THOK + &lspr[NOLIGHT], // SPR_THKE &lspr[SUPERSONIC_L],// SPR_PLAY // Enemies From afb2a9b1dfd80685c1e903c7bd5a3ad742a90996 Mon Sep 17 00:00:00 2001 From: Radicalicious Date: Fri, 18 Jun 2021 02:41:36 -0400 Subject: [PATCH 07/23] Update info.c --- src/info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/info.c b/src/info.c index 351d1ea88..d8b07a9f5 100644 --- a/src/info.c +++ b/src/info.c @@ -4037,7 +4037,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags S_NULL // raisestate }, From 3e2e1399a372ccec3d8ec24e64c28ef3cb15c389 Mon Sep 17 00:00:00 2001 From: Radicalicious Date: Fri, 18 Jun 2021 02:49:07 -0400 Subject: [PATCH 08/23] Update g_demo.c --- src/g_demo.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/g_demo.c b/src/g_demo.c index 9f955f13b..962582493 100644 --- a/src/g_demo.c +++ b/src/g_demo.c @@ -786,11 +786,11 @@ void G_GhostTicker(void) } else if (type == MT_THOKEFFECT) { - mobj = P_SpawnMobjFromMobj(g->mo, 0, 0, g->mo->scale * 24, type); + mobj = P_SpawnMobjFromMobj(g->mo, 0, 0, FRACUNIT * 24, type); mobj->angle = g->mo->angle + ANGLE_90; mobj->fuse = 7; - mobj->scale = FRACUNIT / 3; - mobj->destscale = 10*FRACUNIT; + mobj->scale = g->mo->scale / 3; + mobj->destscale = 10 * g->mo->scale; mobj->colorized = true; mobj->color = g->mo->color; mobj->momx = -g->mo->momx / 2; @@ -1089,11 +1089,11 @@ void G_ReadMetalTic(mobj_t *metal) } else if (type == MT_THOKEFFECT) { - mobj = P_SpawnMobjFromMobj(metal, 0, 0, metal->scale * 24, type); + mobj = P_SpawnMobjFromMobj(metal, 0, 0, FRACUNIT * 24, type); mobj->angle = metal->angle + ANGLE_90; mobj->fuse = 7; - mobj->scale = FRACUNIT / 3; - mobj->destscale = 10*FRACUNIT; + mobj->scale = metal->scale / 3; + mobj->destscale = 10 * metal->scale; mobj->colorized = true; mobj->color = metal->color; mobj->momx = -metal->momx / 2; From bde1b08cbe647ed167306cae224f54a8fbd72b2f Mon Sep 17 00:00:00 2001 From: Radicalicious Date: Fri, 18 Jun 2021 02:50:08 -0400 Subject: [PATCH 09/23] Update p_user.c --- src/p_user.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index f920ba4a6..83b95c3c8 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2077,11 +2077,11 @@ void P_SpawnThokMobj(player_t *player) mobj = P_SpawnGhostMobj(player->mo); // virtually does everything here for us else if (type == MT_THOKEFFECT) // Thok boom effect for Sonic { - mobj = P_SpawnMobjFromMobj(player->mo, 0, 0, player->mo->scale * 24, type); + mobj = P_SpawnMobjFromMobj(player->mo, 0, 0, FRACUNIT * 24, type); mobj->angle = player->mo->angle + ANGLE_90; mobj->fuse = 7; - mobj->scale = FRACUNIT / 3; - mobj->destscale = 10*FRACUNIT; + mobj->scale = player->mo->scale / 3; + mobj->destscale = 10 * player->mo->scale; mobj->colorized = true; mobj->color = player->mo->color; mobj->momx = -player->mo->momx / 2; From 38be20af960aa6d421022e284c12ce56dd2fe314 Mon Sep 17 00:00:00 2001 From: Radicalicious Date: Fri, 18 Jun 2021 11:28:50 -0400 Subject: [PATCH 10/23] Fix indentation --- src/g_demo.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/g_demo.c b/src/g_demo.c index 962582493..89863f6c0 100644 --- a/src/g_demo.c +++ b/src/g_demo.c @@ -786,15 +786,15 @@ void G_GhostTicker(void) } else if (type == MT_THOKEFFECT) { - mobj = P_SpawnMobjFromMobj(g->mo, 0, 0, FRACUNIT * 24, type); - mobj->angle = g->mo->angle + ANGLE_90; - mobj->fuse = 7; - mobj->scale = g->mo->scale / 3; - mobj->destscale = 10 * g->mo->scale; - mobj->colorized = true; - mobj->color = g->mo->color; - mobj->momx = -g->mo->momx / 2; - mobj->momy = -g->mo->momy / 2; + mobj = P_SpawnMobjFromMobj(g->mo, 0, 0, FRACUNIT * 24, type); + mobj->angle = g->mo->angle + ANGLE_90; + mobj->fuse = 7; + mobj->scale = g->mo->scale / 3; + mobj->destscale = 10 * g->mo->scale; + mobj->colorized = true; + mobj->color = g->mo->color; + mobj->momx = -g->mo->momx / 2; + mobj->momy = -g->mo->momy / 2; } else @@ -1090,14 +1090,14 @@ void G_ReadMetalTic(mobj_t *metal) else if (type == MT_THOKEFFECT) { mobj = P_SpawnMobjFromMobj(metal, 0, 0, FRACUNIT * 24, type); - mobj->angle = metal->angle + ANGLE_90; - mobj->fuse = 7; - mobj->scale = metal->scale / 3; - mobj->destscale = 10 * metal->scale; - mobj->colorized = true; - mobj->color = metal->color; - mobj->momx = -metal->momx / 2; - mobj->momy = -metal->momy / 2; + mobj->angle = metal->angle + ANGLE_90; + mobj->fuse = 7; + mobj->scale = metal->scale / 3; + mobj->destscale = 10 * metal->scale; + mobj->colorized = true; + mobj->color = metal->color; + mobj->momx = -metal->momx / 2; + mobj->momy = -metal->momy / 2; } else { From a6ab670294d908db328a8508fb1f9d9e3d6aeb30 Mon Sep 17 00:00:00 2001 From: Radicalicious Date: Fri, 18 Jun 2021 11:29:43 -0400 Subject: [PATCH 11/23] Update info.c --- src/info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/info.c b/src/info.c index d8b07a9f5..bc5e23055 100644 --- a/src/info.c +++ b/src/info.c @@ -4016,7 +4016,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_THOKEFFECT -1, // doomednum - S_THOK, // spawnstate + S_THOKEFFECT, // spawnstate 1000, // spawnhealth S_NULL, // seestate sfx_None, // seesound From 4129140b4ac967e3fc1f8e03acfb044ec3d4443a Mon Sep 17 00:00:00 2001 From: Radicalicious Date: Sun, 20 Jun 2021 21:01:40 -0400 Subject: [PATCH 12/23] Update p_user.c --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 83b95c3c8..9a68e6e9e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2077,7 +2077,7 @@ void P_SpawnThokMobj(player_t *player) mobj = P_SpawnGhostMobj(player->mo); // virtually does everything here for us else if (type == MT_THOKEFFECT) // Thok boom effect for Sonic { - mobj = P_SpawnMobjFromMobj(player->mo, 0, 0, FRACUNIT * 24, type); + mobj = P_SpawnMobjFromMobj(player->mo, 0, 0, FixedDiv(player->mo->height, player->mo->scale)*3/4, type); mobj->angle = player->mo->angle + ANGLE_90; mobj->fuse = 7; mobj->scale = player->mo->scale / 3; From e6fbd482adfb5452fd924eed0ab77c77b8e521b3 Mon Sep 17 00:00:00 2001 From: Radicalicious Date: Sun, 20 Jun 2021 21:02:32 -0400 Subject: [PATCH 13/23] Update g_demo.c --- src/g_demo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g_demo.c b/src/g_demo.c index 89863f6c0..05d173dcf 100644 --- a/src/g_demo.c +++ b/src/g_demo.c @@ -786,7 +786,7 @@ void G_GhostTicker(void) } else if (type == MT_THOKEFFECT) { - mobj = P_SpawnMobjFromMobj(g->mo, 0, 0, FRACUNIT * 24, type); + mobj = P_SpawnMobjFromMobj(g->mo, 0, 0, FixedDiv(g->mo->height, g->mo->scale)*3/4, type); mobj->angle = g->mo->angle + ANGLE_90; mobj->fuse = 7; mobj->scale = g->mo->scale / 3; @@ -1089,7 +1089,7 @@ void G_ReadMetalTic(mobj_t *metal) } else if (type == MT_THOKEFFECT) { - mobj = P_SpawnMobjFromMobj(metal, 0, 0, FRACUNIT * 24, type); + mobj = P_SpawnMobjFromMobj(metal, 0, 0, FixedDiv(metal->height, metal->scale)*3/4, type); mobj->angle = metal->angle + ANGLE_90; mobj->fuse = 7; mobj->scale = metal->scale / 3; From 99c4cc246ed20c1281c396a2b068dc8d56734c6a Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Sat, 14 Aug 2021 21:54:19 -0500 Subject: [PATCH 14/23] Rework `bind` command's argument list to accept additional arguments as arguments to the command being bound. --- src/console.c | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/src/console.c b/src/console.c index b3c413840..cce82a62c 100644 --- a/src/console.c +++ b/src/console.c @@ -209,13 +209,16 @@ static char *bindtable[NUMINPUTS]; static void CONS_Bind_f(void) { size_t na; + char *newcmd; + //size_t newlen = 0; + unsigned int i; INT32 key; na = COM_Argc(); - if (na != 2 && na != 3) + if (na < 2) { - CONS_Printf(M_GetText("bind []: create shortcut keys to command(s)\n")); + CONS_Printf(M_GetText("bind [] [] [...]: create shortcut keys to command(s)\n")); CONS_Printf("\x82%s", M_GetText("Bind table :\n")); na = 0; for (key = 0; key < NUMINPUTS; key++) @@ -239,8 +242,36 @@ static void CONS_Bind_f(void) Z_Free(bindtable[key]); bindtable[key] = NULL; - if (na == 3) - bindtable[key] = Z_StrDup(COM_Argv(2)); + if (na < 3) + return; + + for (i = 2; i < na; ++i) + { + const char *arg = COM_Argv(i); + + // on the second iteration, and after + if (i > 2) + { + size_t newlen = strlen(bindtable[key]) + strlen(arg) + 1; // new length, allow space for ' ' and '\0' + size_t curpos = newcmd - bindtable[key]; // offset from newcmd to original pointer + + newcmd = bindtable[key] = Z_Realloc(bindtable[key], newlen, PU_STATIC, NULL); + newcmd += curpos; // reapply offset + + newcmd[0] = ' '; // replace previous '\0' w/ ' ' + ++newcmd; // make sure later strcpy doesnt overwrite ' ' + } + // first iteration + else + // allocate space for argument and a ' ' or '\0' + newcmd = bindtable[key] = Z_Calloc(strlen(arg) + 1, PU_STATIC, NULL); + + // the copy + strcpy(newcmd, arg); + + // move window past copied argument for next iteration + newcmd += strlen(arg); + } } //====================================================================== From 9441bafb091fbc510e48e3360770c8b63782de2d Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Sun, 5 Sep 2021 14:38:51 -0500 Subject: [PATCH 15/23] Restructure the code to be able to possibly support loadfile. --- src/blua/lbaselib.c | 2 +- src/lua_script.c | 88 +++++++++++++++++++++++++++++++++++---------- src/lua_script.h | 3 +- src/w_wad.c | 8 ++--- 4 files changed, 76 insertions(+), 25 deletions(-) diff --git a/src/blua/lbaselib.c b/src/blua/lbaselib.c index 644565c28..9d4e30eb1 100644 --- a/src/blua/lbaselib.c +++ b/src/blua/lbaselib.c @@ -282,7 +282,7 @@ static int luaB_dofile (lua_State *L) { if (lumpnum == INT16_MAX) luaL_error(L, "can't find script " LUA_QS, fullfilename); - LUA_LoadLump(numwadfiles - 1, lumpnum, false); + LUA_DoLump(numwadfiles - 1, lumpnum, false); return lua_gettop(L) - n; } diff --git a/src/lua_script.c b/src/lua_script.c index 9eb1912b3..1cc95306e 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -554,64 +554,114 @@ void LUA_ClearExtVars(void) INT32 lua_lumploading = 0; // Load a script from a MYFILE -static inline void LUA_LoadFile(MYFILE *f, char *name, boolean noresults) +static inline boolean LUA_LoadFile(MYFILE *f, char *name) { int errorhandlerindex; + boolean success; if (!name) name = wadfiles[f->wad]->filename; + CONS_Printf("Loading Lua script from %s\n", name); + if (!gL) // Lua needs to be initialized LUA_ClearState(); + lua_pushinteger(gL, f->wad); lua_setfield(gL, LUA_REGISTRYINDEX, "WAD"); + lua_pushcfunction(gL, LUA_GetErrorMessage); + errorhandlerindex = lua_gettop(gL); + + success = !luaL_loadbuffer(gL, f->data, f->size, va("@%s",name)); + + if (!success) { + CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL,-1)); + lua_pop(gL,1); + } + + lua_gc(gL, LUA_GCCOLLECT, 0); + lua_remove(gL, errorhandlerindex); + + return success; +} + +// Runs a script loaded by LUA_LoadFile. +static inline void LUA_DoFile(boolean noresults) +{ + int errorhandlerindex; + + if (!gL) // LUA_LoadFile should've allocated gL for us! + return; + lua_lumploading++; // turn on loading flag lua_pushcfunction(gL, LUA_GetErrorMessage); - errorhandlerindex = lua_gettop(gL); - if (luaL_loadbuffer(gL, f->data, f->size, va("@%s",name)) || lua_pcall(gL, 0, noresults ? 0 : LUA_MULTRET, lua_gettop(gL) - 1)) { + lua_insert(gL, -2); // move the function we're calling to the top. + errorhandlerindex = lua_gettop(gL) - 1; + + if (lua_pcall(gL, 0, noresults ? 0 : LUA_MULTRET, lua_gettop(gL) - 1)) { CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL,-1)); lua_pop(gL,1); } + lua_gc(gL, LUA_GCCOLLECT, 0); lua_remove(gL, errorhandlerindex); lua_lumploading--; // turn off again } -// Load a script from a lump -void LUA_LoadLump(UINT16 wad, UINT16 lump, boolean noresults) +static inline MYFILE *LUA_GetFile(UINT16 wad, UINT16 lump, char **name) { - MYFILE f; - char *name; + MYFILE *f = Z_Malloc(sizeof(MYFILE), PU_LUA, NULL); size_t len; - f.wad = wad; - f.size = W_LumpLengthPwad(wad, lump); - f.data = Z_Malloc(f.size, PU_LUA, NULL); - W_ReadLumpPwad(wad, lump, f.data); - f.curpos = f.data; + + f->wad = wad; + f->size = W_LumpLengthPwad(wad, lump); + f->data = Z_Malloc(f->size, PU_LUA, NULL); + W_ReadLumpPwad(wad, lump, f->data); + f->curpos = f->data; len = strlen(wadfiles[wad]->filename); // length of file name if (wadfiles[wad]->type == RET_LUA) { - name = malloc(len+1); - strcpy(name, wadfiles[wad]->filename); + *name = malloc(len+1); + strcpy(*name, wadfiles[wad]->filename); } else // If it's not a .lua file, copy the lump name in too. { lumpinfo_t *lump_p = &wadfiles[wad]->lumpinfo[lump]; len += 1 + strlen(lump_p->fullname); // length of file name, '|', and lump name - name = malloc(len+1); - sprintf(name, "%s|%s", wadfiles[wad]->filename, lump_p->fullname); - name[len] = '\0'; + *name = malloc(len+1); + sprintf(*name, "%s|%s", wadfiles[wad]->filename, lump_p->fullname); + (*name)[len] = '\0'; // annoying that index takes priority over dereference, but w/e } - LUA_LoadFile(&f, name, noresults); // actually load file! + return f; +} + +// Load a script from a lump +boolean LUA_LoadLump(UINT16 wad, UINT16 lump) +{ + char *name = NULL; + MYFILE *f = LUA_GetFile(wad, lump, &name); + boolean success = LUA_LoadFile(f, name); // actually load file! free(name); - Z_Free(f.data); + + Z_Free(f->data); + Z_Free(f); + + return success; +} + +void LUA_DoLump(UINT16 wad, UINT16 lump, boolean noresults) +{ + boolean success = LUA_LoadLump(wad, lump); + + if (success) + LUA_DoFile(noresults); // run it } #ifdef LUA_ALLOW_BYTECODE diff --git a/src/lua_script.h b/src/lua_script.h index e88256941..6b7c21124 100644 --- a/src/lua_script.h +++ b/src/lua_script.h @@ -45,7 +45,8 @@ extern INT32 lua_lumploading; // is LUA_LoadLump being called? int LUA_GetErrorMessage(lua_State *L); int LUA_Call(lua_State *L, int nargs, int nresults, int errorhandlerindex); -void LUA_LoadLump(UINT16 wad, UINT16 lump, boolean noresults); +boolean LUA_LoadLump(UINT16 wad, UINT16 lump); +void LUA_DoLump(UINT16 wad, UINT16 lump, boolean noresults); #ifdef LUA_ALLOW_BYTECODE void LUA_DumpFile(const char *filename); #endif diff --git a/src/w_wad.c b/src/w_wad.c index cbff5c67b..e3dc3a971 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -199,7 +199,7 @@ static inline void W_LoadDehackedLumpsPK3(UINT16 wadnum, boolean mainfile) posStart = W_CheckNumForFullNamePK3("Init.lua", wadnum, 0); if (posStart != INT16_MAX) { - LUA_LoadLump(wadnum, posStart, true); + LUA_DoLump(wadnum, posStart, true); } else { @@ -208,7 +208,7 @@ static inline void W_LoadDehackedLumpsPK3(UINT16 wadnum, boolean mainfile) { posEnd = W_CheckNumForFolderEndPK3("Lua/", wadnum, posStart); for (; posStart < posEnd; posStart++) - LUA_LoadLump(wadnum, posStart, true); + LUA_DoLump(wadnum, posStart, true); } } @@ -241,7 +241,7 @@ static inline void W_LoadDehackedLumps(UINT16 wadnum, boolean mainfile) lumpinfo_t *lump_p = wadfiles[wadnum]->lumpinfo; for (lump = 0; lump < wadfiles[wadnum]->numlumps; lump++, lump_p++) if (memcmp(lump_p->name,"LUA_",4)==0) - LUA_LoadLump(wadnum, lump, true); + LUA_DoLump(wadnum, lump, true); } { @@ -879,7 +879,7 @@ UINT16 W_InitFile(const char *filename, boolean mainfile, boolean startup) DEH_LoadDehackedLumpPwad(numwadfiles - 1, 0, mainfile); break; case RET_LUA: - LUA_LoadLump(numwadfiles - 1, 0, true); + LUA_DoLump(numwadfiles - 1, 0, true); break; default: break; From bd9118eae7b9f4c988b2d6e072c150d8a84db720 Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Sun, 5 Sep 2021 14:52:40 -0500 Subject: [PATCH 16/23] Implement loadfile --- src/blua/lbaselib.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/blua/lbaselib.c b/src/blua/lbaselib.c index 9d4e30eb1..830043f30 100644 --- a/src/blua/lbaselib.c +++ b/src/blua/lbaselib.c @@ -287,6 +287,25 @@ static int luaB_dofile (lua_State *L) { return lua_gettop(L) - n; } +// Edited to load PK3 entries instead +static int luaB_loadfile (lua_State *L) { + const char *filename = luaL_checkstring(L, 1); + char fullfilename[256]; + UINT16 lumpnum; + int n = lua_gettop(L); + + if (wadfiles[numwadfiles - 1]->type != RET_PK3) + luaL_error(L, "loadfile() only works with PK3 files"); + + snprintf(fullfilename, sizeof(fullfilename), "Lua/%s", filename); + lumpnum = W_CheckNumForFullNamePK3(fullfilename, numwadfiles - 1, 0); + if (lumpnum == INT16_MAX) + luaL_error(L, "can't find script " LUA_QS, fullfilename); + + LUA_LoadLump(numwadfiles - 1, lumpnum); + + return 1; +} static int luaB_assert (lua_State *L) { luaL_checkany(L, 1); @@ -406,6 +425,7 @@ static const luaL_Reg base_funcs[] = { {"collectgarbage", luaB_collectgarbage}, {"error", luaB_error}, {"dofile", luaB_dofile}, + {"loadfile", luaB_loadfile}, {"gcinfo", luaB_gcinfo}, {"getfenv", luaB_getfenv}, {"getmetatable", luaB_getmetatable}, From 6f19615fabe216537d4d59b5a0de717c7df755b1 Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Mon, 6 Sep 2021 15:05:34 -0500 Subject: [PATCH 17/23] Remove unused variable to fix warning in luaB_loadfile. --- src/blua/lbaselib.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/blua/lbaselib.c b/src/blua/lbaselib.c index 830043f30..d7bdc8204 100644 --- a/src/blua/lbaselib.c +++ b/src/blua/lbaselib.c @@ -292,7 +292,6 @@ static int luaB_loadfile (lua_State *L) { const char *filename = luaL_checkstring(L, 1); char fullfilename[256]; UINT16 lumpnum; - int n = lua_gettop(L); if (wadfiles[numwadfiles - 1]->type != RET_PK3) luaL_error(L, "loadfile() only works with PK3 files"); From 2fb1c5f1ef43c142eb5e4ecdb98ea7cac612c8f6 Mon Sep 17 00:00:00 2001 From: Hannu Hanhi Date: Sat, 30 Oct 2021 03:53:46 +0300 Subject: [PATCH 18/23] Wireframe mode for OpenGL --- src/hardware/hw_defs.h | 1 + src/hardware/hw_main.c | 24 ++++++++++++++++++++++++ src/hardware/hw_main.h | 2 ++ src/hardware/r_opengl/r_opengl.c | 7 +++++++ 4 files changed, 34 insertions(+) diff --git a/src/hardware/hw_defs.h b/src/hardware/hw_defs.h index 8df9b8916..139de66e2 100644 --- a/src/hardware/hw_defs.h +++ b/src/hardware/hw_defs.h @@ -295,6 +295,7 @@ enum hwdsetspecialstate HWD_SET_SHADERS, HWD_SET_TEXTUREFILTERMODE, HWD_SET_TEXTUREANISOTROPICMODE, + HWD_SET_WIREFRAME, HWD_NUMSTATE }; diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index e0851af85..198bb3992 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -178,6 +178,11 @@ static boolean HWR_UseShader(void) return (cv_glshaders.value && gl_shadersavailable); } +static boolean HWR_IsWireframeMode(void) +{ + return (cv_glwireframe.value && cv_debug); +} + void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *colormap) { RGBA_t poly_color, tint_color, fade_color; @@ -5642,6 +5647,9 @@ void HWR_BuildSkyDome(void) static void HWR_DrawSkyBackground(player_t *player) { + if (HWR_IsWireframeMode()) + return; + HWD.pfnSetBlend(PF_Translucent|PF_NoDepthTest|PF_Modulated); if (cv_glskydome.value) @@ -5994,6 +6002,9 @@ void HWR_RenderSkyboxView(INT32 viewnumber, player_t *player) // Reset the shader state. HWR_SetShaderState(); + if (HWR_IsWireframeMode()) + HWD.pfnSetSpecialState(HWD_SET_WIREFRAME, 1); + validcount++; if (cv_glbatching.value) @@ -6056,6 +6067,9 @@ void HWR_RenderSkyboxView(INT32 viewnumber, player_t *player) HWR_CreateDrawNodes(); } + if (HWR_IsWireframeMode()) + HWD.pfnSetSpecialState(HWD_SET_WIREFRAME, 0); + HWD.pfnSetTransform(NULL); HWD.pfnUnSetShader(); @@ -6208,6 +6222,9 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player) // Reset the shader state. HWR_SetShaderState(); + if (HWR_IsWireframeMode()) + HWD.pfnSetSpecialState(HWD_SET_WIREFRAME, 1); + ps_numbspcalls = 0; ps_numpolyobjects = 0; ps_bsptime = I_GetPreciseTime(); @@ -6284,6 +6301,9 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player) HWR_CreateDrawNodes(); } + if (HWR_IsWireframeMode()) + HWD.pfnSetSpecialState(HWD_SET_WIREFRAME, 0); + HWD.pfnSetTransform(NULL); HWD.pfnUnSetShader(); @@ -6361,6 +6381,8 @@ consvar_t cv_glsolvetjoin = CVAR_INIT ("gr_solvetjoin", "On", 0, CV_OnOff, NULL) consvar_t cv_glbatching = CVAR_INIT ("gr_batching", "On", 0, CV_OnOff, NULL); +consvar_t cv_glwireframe = CVAR_INIT ("gr_wireframe", "Off", 0, CV_OnOff, NULL); + static void CV_glfiltermode_OnChange(void) { if (rendermode == render_opengl) @@ -6401,6 +6423,8 @@ void HWR_AddCommands(void) CV_RegisterVar(&cv_glbatching); + CV_RegisterVar(&cv_glwireframe); + #ifndef NEWCLIP CV_RegisterVar(&cv_glclipwalls); #endif diff --git a/src/hardware/hw_main.h b/src/hardware/hw_main.h index b751b2a6e..b965ea247 100644 --- a/src/hardware/hw_main.h +++ b/src/hardware/hw_main.h @@ -106,6 +106,8 @@ extern consvar_t cv_glslopecontrast; extern consvar_t cv_glbatching; +extern consvar_t cv_glwireframe; + extern float gl_viewwidth, gl_viewheight, gl_baseviewwindowy; extern float gl_viewwindowx, gl_basewindowcentery; diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index de0e8c6a6..a5a16a0c3 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -301,6 +301,8 @@ typedef void (APIENTRY * PFNglDisable) (GLenum cap); static PFNglDisable pglDisable; typedef void (APIENTRY * PFNglGetFloatv) (GLenum pname, GLfloat *params); static PFNglGetFloatv pglGetFloatv; +typedef void (APIENTRY * PFNglPolygonMode) (GLenum, GLenum); +static PFNglPolygonMode pglPolygonMode; /* Depth Buffer */ typedef void (APIENTRY * PFNglClearDepth) (GLclampd depth); @@ -475,6 +477,7 @@ boolean SetupGLfunc(void) GETOPENGLFUNC(pglGetFloatv, glGetFloatv) GETOPENGLFUNC(pglGetIntegerv, glGetIntegerv) GETOPENGLFUNC(pglGetString, glGetString) + GETOPENGLFUNC(pglPolygonMode, glPolygonMode) GETOPENGLFUNC(pglClearDepth, glClearDepth) GETOPENGLFUNC(pglDepthFunc, glDepthFunc) @@ -2467,6 +2470,10 @@ EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value) Flush(); //??? if we want to change filter mode by texture, remove this break; + case HWD_SET_WIREFRAME: + pglPolygonMode(GL_FRONT_AND_BACK, Value ? GL_LINE : GL_FILL); + break; + default: break; } From 54ba225164605bb1bc69aa33468d1861e715e28f Mon Sep 17 00:00:00 2001 From: Zwip-Zwap Zapony Date: Thu, 14 Dec 2023 21:42:43 +0100 Subject: [PATCH 19/23] Update player->quittime while a server is idling --- src/netcode/d_clisrv.c | 33 +++++++++++++++++++++++++++++++++ src/p_tick.c | 16 +--------------- 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/src/netcode/d_clisrv.c b/src/netcode/d_clisrv.c index 7804b068f..de22d601b 100644 --- a/src/netcode/d_clisrv.c +++ b/src/netcode/d_clisrv.c @@ -116,6 +116,8 @@ consvar_t cv_playbackspeed = CVAR_INIT ("playbackspeed", "1", 0, playbackspeed_c consvar_t cv_idletime = CVAR_INIT ("idletime", "0", CV_SAVE, CV_Unsigned, NULL); consvar_t cv_dedicatedidletime = CVAR_INIT ("dedicatedidletime", "10", CV_SAVE, CV_Unsigned, NULL); +static INT32 D_NumNodes(boolean skiphost); + void ResetNode(INT32 node) { memset(&netnodes[node], 0, sizeof(*netnodes)); @@ -1275,6 +1277,7 @@ static void UpdatePingTable(void) } } +// Handle idle and disconnected player timers static void IdleUpdate(void) { INT32 i; @@ -1297,7 +1300,26 @@ static void IdleUpdate(void) } } else + { players[i].lastinputtime = 0; + + if (players[i].quittime && playeringame[i]) + { + players[i].quittime++; + + if (players[i].quittime == 30 * TICRATE && G_TagGametype()) + P_CheckSurvivors(); + + if (server && players[i].quittime >= (tic_t)FixedMul(cv_rejointimeout.value, 60 * TICRATE) + && !(players[i].quittime % TICRATE)) + { + if (D_NumNodes(true) > 0) + SendKick(i, KICK_MSG_PLAYER_QUIT); + else // If the server is empty, don't send a NetXCmd - that would wake an idling dedicated server + CL_RemovePlayer(i, KICK_MSG_PLAYER_QUIT); + } + } + } } } @@ -1631,6 +1653,17 @@ INT32 D_NumBots(void) return num; } +// Returns the number of currently-connected nodes in a netgame +// Not necessarily equivalent to D_NumPlayers() minus D_NumBots() +static INT32 D_NumNodes(boolean skiphost) +{ + INT32 num = 0, ix; + for (ix = skiphost ? 1 : 0; ix < MAXNETNODES; ix++) + if (netnodes[ix].ingame) + num++; + return num; +} + // // Consistancy diff --git a/src/p_tick.c b/src/p_tick.c index 1bc7b78bf..3934890f1 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -690,25 +690,11 @@ void P_Ticker(boolean run) { INT32 i; - // Increment jointime and quittime even if paused + // Increment jointime even if paused for (i = 0; i < MAXPLAYERS; i++) if (playeringame[i]) - { players[i].jointime++; - if (players[i].quittime) - { - players[i].quittime++; - - if (players[i].quittime == 30 * TICRATE && G_TagGametype()) - P_CheckSurvivors(); - - if (server && players[i].quittime >= (tic_t)FixedMul(cv_rejointimeout.value, 60 * TICRATE) - && !(players[i].quittime % TICRATE)) - SendKick(i, KICK_MSG_PLAYER_QUIT); - } - } - if (objectplacing) { if (OP_FreezeObjectplace()) From b3ef2b3344e0f510f4f24dd6f3c21326ca2e5eda Mon Sep 17 00:00:00 2001 From: LJ Sonic Date: Thu, 28 Dec 2023 17:32:36 +0100 Subject: [PATCH 20/23] Support loadfile in folder add-ons too --- src/blua/lbaselib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/blua/lbaselib.c b/src/blua/lbaselib.c index 452f101c4..2bb3d9cf0 100644 --- a/src/blua/lbaselib.c +++ b/src/blua/lbaselib.c @@ -275,7 +275,7 @@ static int luaB_dofile (lua_State *L) { int n = lua_gettop(L); if (!W_FileHasFolders(wadfiles[numwadfiles - 1])) - luaL_error(L, "dofile() only works with PK3 files"); + luaL_error(L, "dofile() only works with PK3 files and folders"); snprintf(fullfilename, sizeof(fullfilename), "Lua/%s", filename); lumpnum = W_CheckNumForFullNamePK3(fullfilename, numwadfiles - 1, 0); @@ -293,8 +293,8 @@ static int luaB_loadfile (lua_State *L) { char fullfilename[256]; UINT16 lumpnum; - if (wadfiles[numwadfiles - 1]->type != RET_PK3) - luaL_error(L, "loadfile() only works with PK3 files"); + if (!W_FileHasFolders(wadfiles[numwadfiles - 1])) + luaL_error(L, "loadfile() only works with PK3 files and folders"); snprintf(fullfilename, sizeof(fullfilename), "Lua/%s", filename); lumpnum = W_CheckNumForFullNamePK3(fullfilename, numwadfiles - 1, 0); From 849455bba72bc80aabb9303582f6130b134af611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustaf=20Alh=C3=A4ll?= Date: Thu, 28 Dec 2023 21:52:48 +0100 Subject: [PATCH 21/23] Fix one too many player count on dedicated servers --- src/netcode/server_connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/netcode/server_connection.c b/src/netcode/server_connection.c index faff7e8dd..bfbe30a08 100644 --- a/src/netcode/server_connection.c +++ b/src/netcode/server_connection.c @@ -109,7 +109,7 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime) netbuffer->u.serverinfo.leveltime = (tic_t)LONG(leveltime); // Exclude bots from both counts - netbuffer->u.serverinfo.numberofplayer = (UINT8)D_NumNodes(); + netbuffer->u.serverinfo.numberofplayer = (UINT8)(D_NumNodes() - (dedicated ? 1 : 0)); netbuffer->u.serverinfo.maxplayer = (UINT8)(cv_maxplayers.value - D_NumBots()); netbuffer->u.serverinfo.refusereason = GetRefuseReason(node); From e7d972757bb2a104e6c4d1fc36a10c0186463a8d Mon Sep 17 00:00:00 2001 From: Logan Aerl Arias Date: Sun, 31 Dec 2023 14:32:06 +0000 Subject: [PATCH 22/23] Revert "Merge branch 'update-quittime-while-idling' into 'next'" This reverts merge request !2210 --- src/netcode/d_clisrv.c | 33 --------------------------------- src/p_tick.c | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 34 deletions(-) diff --git a/src/netcode/d_clisrv.c b/src/netcode/d_clisrv.c index fc5aa9afd..d222920c3 100644 --- a/src/netcode/d_clisrv.c +++ b/src/netcode/d_clisrv.c @@ -116,8 +116,6 @@ consvar_t cv_playbackspeed = CVAR_INIT ("playbackspeed", "1", 0, playbackspeed_c consvar_t cv_idletime = CVAR_INIT ("idletime", "0", CV_SAVE, CV_Unsigned, NULL); consvar_t cv_dedicatedidletime = CVAR_INIT ("dedicatedidletime", "10", CV_SAVE, CV_Unsigned, NULL); -static INT32 D_NumNodes(boolean skiphost); - void ResetNode(INT32 node) { memset(&netnodes[node], 0, sizeof(*netnodes)); @@ -1282,7 +1280,6 @@ static void UpdatePingTable(void) } } -// Handle idle and disconnected player timers static void IdleUpdate(void) { INT32 i; @@ -1305,26 +1302,7 @@ static void IdleUpdate(void) } } else - { players[i].lastinputtime = 0; - - if (players[i].quittime && playeringame[i]) - { - players[i].quittime++; - - if (players[i].quittime == 30 * TICRATE && G_TagGametype()) - P_CheckSurvivors(); - - if (server && players[i].quittime >= (tic_t)FixedMul(cv_rejointimeout.value, 60 * TICRATE) - && !(players[i].quittime % TICRATE)) - { - if (D_NumNodes(true) > 0) - SendKick(i, KICK_MSG_PLAYER_QUIT); - else // If the server is empty, don't send a NetXCmd - that would wake an idling dedicated server - CL_RemovePlayer(i, KICK_MSG_PLAYER_QUIT); - } - } - } } } @@ -1669,17 +1647,6 @@ INT32 D_NumBots(void) return num; } -// Returns the number of currently-connected nodes in a netgame -// Not necessarily equivalent to D_NumPlayers() minus D_NumBots() -static INT32 D_NumNodes(boolean skiphost) -{ - INT32 num = 0, ix; - for (ix = skiphost ? 1 : 0; ix < MAXNETNODES; ix++) - if (netnodes[ix].ingame) - num++; - return num; -} - // // Consistancy diff --git a/src/p_tick.c b/src/p_tick.c index db6777bca..dca806ebe 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -701,11 +701,25 @@ void P_Ticker(boolean run) { INT32 i; - // Increment jointime even if paused + // Increment jointime and quittime even if paused for (i = 0; i < MAXPLAYERS; i++) if (playeringame[i]) + { players[i].jointime++; + if (players[i].quittime) + { + players[i].quittime++; + + if (players[i].quittime == 30 * TICRATE && G_TagGametype()) + P_CheckSurvivors(); + + if (server && players[i].quittime >= (tic_t)FixedMul(cv_rejointimeout.value, 60 * TICRATE) + && !(players[i].quittime % TICRATE)) + SendKick(i, KICK_MSG_PLAYER_QUIT); + } + } + if (objectplacing) { if (OP_FreezeObjectplace()) From 8d179825d9ddfd8d3f6020f90c2f740d33b7f92e Mon Sep 17 00:00:00 2001 From: Logan Aerl Arias Date: Sun, 31 Dec 2023 15:56:37 +0000 Subject: [PATCH 23/23] switch to using sanitized subject for compnote --- comptime.bat | 2 +- comptime.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/comptime.bat b/comptime.bat index 77879d5ee..c03f088b2 100644 --- a/comptime.bat +++ b/comptime.bat @@ -16,7 +16,7 @@ set GIT=%2 if "%GIT%"=="" set GIT=git for /f "tokens=* usebackq" %%s in (`%GIT% rev-parse --abbrev-ref HEAD`) do @set BRA=%%s for /f "tokens=* usebackq" %%s in (`%GIT% rev-parse HEAD`) do @set REV=%%s -for /f "tokens=* usebackq" %%s in (`%GIT% log -1 --format^=%%s`) do @set GL1=%%s +for /f "tokens=* usebackq" %%s in (`%GIT% log -1 --format^=%%f`) do @set GL1=%%s set REV=%REV:~0,8% goto filwri diff --git a/comptime.sh b/comptime.sh index e37ba6ad7..3338ecc35 100755 --- a/comptime.sh +++ b/comptime.sh @@ -19,7 +19,7 @@ EOF versiongit() { gitbranch="$(git rev-parse --abbrev-ref HEAD)" gitversion="$(git rev-parse HEAD | cut -c -8)" - gitsubject="$(git log -1 --format=%s)" + gitsubject="$(git log -1 --format=%f)" version "$gitbranch" "$gitversion" "$gitsubject"; exit 0 }