From 7270ae178d1483f5b6e2e620f5a60a078b942b56 Mon Sep 17 00:00:00 2001 From: NepDisk Date: Sat, 22 Mar 2025 16:57:35 -0400 Subject: [PATCH] Support for MF2_SHADOW --- src/deh_tables.c | 2 +- src/lua_mobjlib.c | 7 +++++++ src/p_mobj.h | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/deh_tables.c b/src/deh_tables.c index c0f42c9e7..e82ded972 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -165,7 +165,7 @@ const char *const MOBJFLAG_LIST[] = { // \tMF2_(\S+).*// (.+) --> \t"\1", // \2 const char *const MOBJFLAG2_LIST[] = { "AXIS", // It's a NiGHTS axis! (For faster checking) - "\x01", // free: 1<<1 (name un-matchable) + "SHADOW", // alias for RF_GHOSTLY "DONTRESPAWN", // Don't respawn this object! "DONTDRAW", // alias for RF_DONTDRAW "AUTOMATIC", // Thrown ring has automatic properties diff --git a/src/lua_mobjlib.c b/src/lua_mobjlib.c index 6d826e3bb..2b0a0fc46 100644 --- a/src/lua_mobjlib.c +++ b/src/lua_mobjlib.c @@ -379,6 +379,8 @@ static int mobj_get(lua_State *L) UINT32 flags2 = mo->flags2; if (lua_compatmode && (mo->renderflags & RF_DONTDRAW) == RF_DONTDRAW) flags2 |= MF2_DONTDRAW; + if (lua_compatmode && (mo->renderflags & RF_GHOSTLY) == RF_GHOSTLY) + flags2 |= MF2_SHADOW; lua_pushinteger(L, flags2); break; } @@ -818,6 +820,11 @@ static int mobj_set(lua_State *L) mo->renderflags |= RF_DONTDRAW; else mo->renderflags &= ~RF_DONTDRAW; + + if (flags2 & MF2_SHADOW) + mo->renderflags |= RF_GHOSTLY; + else + mo->renderflags &= ~RF_GHOSTLYMASK; } mo->flags2 = flags2; break; diff --git a/src/p_mobj.h b/src/p_mobj.h index 7244ce061..109ea99bc 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -173,7 +173,7 @@ typedef enum typedef enum { MF2_AXIS = 1, // It's a NiGHTS axis! (For faster checking) - // free: 1<<1 + MF2_SHADOW = 1<<3, // DO NOT USE: for lua compatibility only MF2_DONTRESPAWN = 1<<2, // Don't respawn this object! MF2_DONTDRAW = 1<<3, // DO NOT USE: for lua compatibility only MF2_AUTOMATIC = 1<<4, // Thrown ring has automatic properties