Compat changes for TOLs

This commit is contained in:
NepDisk 2025-04-15 16:35:52 -04:00
parent 67fd8018a8
commit 1d1f697f2f
5 changed files with 27 additions and 9 deletions

View file

@ -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);

View file

@ -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

View file

@ -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}
};

View file

@ -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);

View file

@ -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);