From 1d1f697f2f687b59d6082c244b3299f8008b1756 Mon Sep 17 00:00:00 2001 From: NepDisk Date: Tue, 15 Apr 2025 16:35:52 -0400 Subject: [PATCH] Compat changes for TOLs --- src/deh_lua.c | 5 ----- src/doomstat.h | 12 ++++++++++-- src/g_game.c | 14 ++++++++++++++ src/k_collide.c | 2 +- src/lua_baselib.c | 3 ++- 5 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/deh_lua.c b/src/deh_lua.c index 66e5bf290..edfe28ea1 100644 --- a/src/deh_lua.c +++ b/src/deh_lua.c @@ -353,11 +353,6 @@ static int ScanConstants(lua_State *L, boolean mathlib, const char *word) } else if (fastncmp("TOL_", word, 4)) { p = word+4; - if (lua_compatmode && fastcmp(p, "MATCH")) - { - CacheAndPushConstant(L, word, ((lua_Integer)TOL_BATTLE)); - return 1; - } for (i = 0; TYPEOFLEVEL[i].name; i++) if (fastcmp(p, TYPEOFLEVEL[i].name)) { CacheAndPushConstant(L, word, TYPEOFLEVEL[i].flag); diff --git a/src/doomstat.h b/src/doomstat.h index 05369c06e..56484033a 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -530,12 +530,20 @@ enum TypeOfLevel TOL_BATTLE = 0x0002, ///< Battle TOL_BOSS = 0x0004, ///< Boss (variant of battle, but forbidden) + // Compat + TOL_COMPAT1 = 0x0008, ///< For compat. Handles all the unused kart v1 types. + TOL_COMPAT2 = 0x0010, ///< ^ + TOL_COMPAT3 = 0x0020, ///< ^ + TOL_COMPAT4 = 0x0040, ///< ^ + TOL_COMPAT5 = 0x0080, ///< ^ + TOL_COMPAT6 = 0x0100, ///< ^ + // Modifiers - TOL_TV = 0x0100 ///< Midnight Channel specific: draw TV like overlay on HUD + TOL_TV = 0x0200 ///< Midnight Channel specific: draw TV like overlay on HUD }; #define MAXTOL (1<<31) -#define NUMBASETOLNAMES (4) +#define NUMBASETOLNAMES (10) #define NUMTOLNAMES (NUMBASETOLNAMES + NUMGAMETYPEFREESLOTS) struct tolinfo_t diff --git a/src/g_game.c b/src/g_game.c index 88386cdef..2a986e894 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3411,6 +3411,20 @@ tolinfo_t TYPEOFLEVEL[NUMTOLNAMES] = { {"BATTLE",TOL_BATTLE}, {"BOSS",TOL_BOSS}, {"TV",TOL_TV}, + + // Compat stuff + {"MATCH",TOL_BATTLE}, + {"SOLO",TOL_COMPAT1}, + {"SP",TOL_COMPAT1}, + {"SINGLEPLAYER",TOL_COMPAT1}, + {"SINGLE",TOL_COMPAT1}, + {"COOP",TOL_COMPAT2}, + {"CO-OP",TOL_COMPAT2}, + {"COMPETITION",TOL_COMPAT3}, + {"TAG",TOL_COMPAT4}, + {"CTF",TOL_COMPAT5}, + {"CUSTOM",TOL_COMPAT6}, + {NULL, 0} }; diff --git a/src/k_collide.c b/src/k_collide.c index 6b0a1fe28..c8d1b605e 100644 --- a/src/k_collide.c +++ b/src/k_collide.c @@ -584,7 +584,7 @@ boolean K_DropTargetCollide(mobj_t *t1, mobj_t *t2) ghost->fuse = 10; ghost->scalespeed = (ghost->destscale - ghost->scale)/ghost->fuse; - for (i = 0; i < 2; i++) + for (SINT8 i = 0; i < 2; i++) { mobj_t *blast = P_SpawnMobjFromMobj(t1, 0, 0, FixedDiv(t1->height, t1->scale), MT_BATTLEBUMPER_BLAST); P_SetScale(blast, 5*blast->scale/2); diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 352a13faa..971c6c023 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1523,7 +1523,8 @@ static int lib_pTeleportMove(lua_State *L) INLEVEL if (!thing) return LUA_ErrInvalid(L, "mobj_t"); - LUA_Deprecated(L, "P_TeleportMove", "P_SetOrigin\" or \"P_MoveOrigin"); + // Be quiet. + //LUA_Deprecated(L, "P_TeleportMove", "P_SetOrigin\" or \"P_MoveOrigin"); lua_pushboolean(L, P_MoveOrigin(thing, x, y, z)); LUA_PushUserdata(L, g_tm.thing, META_MOBJ); P_RestoreTMStruct(ptm);