mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-31 05:30:48 +00:00
Merge branch 'next' into bbox
This commit is contained in:
commit
264ec02223
249 changed files with 1900 additions and 1023 deletions
|
@ -1,4 +1,4 @@
|
|||
version: 2.2.10.{branch}-{build}
|
||||
version: 2.2.11.{branch}-{build}
|
||||
os: MinGW
|
||||
|
||||
environment:
|
||||
|
|
|
@ -29,6 +29,7 @@ set(SRB2_ASSETS_GAME
|
|||
"srb2.pk3"
|
||||
"player.dta"
|
||||
"zones.pk3"
|
||||
"patch.pk3"
|
||||
"music.dta"
|
||||
"models.dat"
|
||||
)
|
||||
|
|
|
@ -39,7 +39,7 @@ https://facebook.com/SonicRoboBlast2
|
|||
|
||||
COPYRIGHT AND DISCLAIMER
|
||||
|
||||
Design and content in Sonic Robo Blast 2 is copyright 1998-2022 by Sonic Team Jr.
|
||||
Design and content in Sonic Robo Blast 2 is copyright 1998-2023 by Sonic Team Jr.
|
||||
|
||||
All original material in this game is copyrighted by their respective owners, and no copyright infringement is intended. Sonic Team Jr. is in no way affiliated with SEGA or Sonic Team, and we do not claim ownership of any of SEGA's intellectual property used in SRB2.
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1301,6 +1301,21 @@ doom
|
|||
title = "Scroll Ceiling Texture (Displacement)";
|
||||
prefix = "(515)";
|
||||
}
|
||||
516
|
||||
{
|
||||
title = "Scroll Floor and Ceiling Texture";
|
||||
prefix = "(516)";
|
||||
}
|
||||
517
|
||||
{
|
||||
title = "Scroll Floor and Ceiling Texture (Accelerative)";
|
||||
prefix = "(517)";
|
||||
}
|
||||
518
|
||||
{
|
||||
title = "Scroll Floor and Ceiling Texture (Displacement)";
|
||||
prefix = "(518)";
|
||||
}
|
||||
520
|
||||
{
|
||||
title = "Carry Objects on Floor";
|
||||
|
@ -1331,6 +1346,21 @@ doom
|
|||
title = "Carry Objects on Ceiling (Displacement)";
|
||||
prefix = "(525)";
|
||||
}
|
||||
526
|
||||
{
|
||||
title = "Carry Objects on Floor and Ceiling";
|
||||
prefix = "(526)";
|
||||
}
|
||||
527
|
||||
{
|
||||
title = "Carry Objects on Floor and Ceiling (Accelerative)";
|
||||
prefix = "(527)";
|
||||
}
|
||||
528
|
||||
{
|
||||
title = "Carry Objects on Floor and Ceiling (Displacement)";
|
||||
prefix = "(528)";
|
||||
}
|
||||
530
|
||||
{
|
||||
title = "Scroll Floor Texture and Carry Objects";
|
||||
|
@ -1361,6 +1391,21 @@ doom
|
|||
title = "Scroll Ceiling Texture and Carry Objects (Displacement)";
|
||||
prefix = "(535)";
|
||||
}
|
||||
536
|
||||
{
|
||||
title = "Scroll Floor and Ceiling Texture and Carry Objects";
|
||||
prefix = "(536)";
|
||||
}
|
||||
537
|
||||
{
|
||||
title = "Scroll Floor and Ceiling Texture and Carry Objects (Accelerative)";
|
||||
prefix = "(537)";
|
||||
}
|
||||
538
|
||||
{
|
||||
title = "Scroll Floor and Ceiling Texture and Carry Objects (Displacement)";
|
||||
prefix = "(538)";
|
||||
}
|
||||
}
|
||||
|
||||
pusher
|
||||
|
@ -4223,6 +4268,16 @@ udmf
|
|||
1 = "Yes";
|
||||
}
|
||||
}
|
||||
arg2
|
||||
{
|
||||
title = "Force MFE_VERTICALFLIP";
|
||||
type = 11;
|
||||
enum
|
||||
{
|
||||
0 = "No";
|
||||
1 = "Yes";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
434
|
||||
|
|
|
@ -265,14 +265,8 @@ universalfields
|
|||
|
||||
triggerer
|
||||
{
|
||||
type = 0;
|
||||
default = 0;
|
||||
enum
|
||||
{
|
||||
0 = "Player";
|
||||
1 = "All players";
|
||||
2 = "Object";
|
||||
}
|
||||
type = 2;
|
||||
default = "Player";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4546,7 +4546,7 @@ udmf
|
|||
sprite = "EMBMA0";
|
||||
width = 16;
|
||||
height = 30;
|
||||
arg0
|
||||
arg1
|
||||
{
|
||||
title = "Float?";
|
||||
type = 11;
|
||||
|
|
|
@ -127,7 +127,9 @@ endif()
|
|||
# Compatibility flag with later versions of GCC
|
||||
# We should really fix our code to not need this
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
target_compile_options(SRB2SDL2 PRIVATE -mno-ms-bitfields)
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|x64|amd64|AMD64|em64t|EM64T)")
|
||||
target_compile_options(SRB2SDL2 PRIVATE -mno-ms-bitfields)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Compiler warnings configuration
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# the poly3 Makefile adapted over and over...
|
||||
#
|
||||
# Copyright 1998-2000 DooM Legacy Team.
|
||||
# Copyright 2020-2022 James R.
|
||||
# Copyright 2003-2022 Sonic Team Junior.
|
||||
# Copyright 2020-2023 James R.
|
||||
# Copyright 2003-2023 Sonic Team Junior.
|
||||
#
|
||||
# This program is free software distributed under the
|
||||
# terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -24,7 +24,7 @@ static INT64 start_time; // as microseconds since the epoch
|
|||
|
||||
// I should probably return how much memory is remaining
|
||||
// for this process, considering Android's process memory limit.
|
||||
UINT32 I_GetFreeMem(UINT32 *total)
|
||||
size_t I_GetFreeMem(size_t *total)
|
||||
{
|
||||
// what the heck? sysinfo() is partially missing in bionic?
|
||||
/* struct sysinfo si; */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2019-2022, James R.
|
||||
Copyright 2019-2023, James R.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2019-2022, James R.
|
||||
Copyright 2019-2023, James R.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2007-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2011-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 2011-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -118,7 +118,7 @@ static void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd)
|
|||
return;
|
||||
}
|
||||
|
||||
// Adapted from CobaltBW's tails_AI.wad
|
||||
// Adapted from clairebun's tails_AI.wad
|
||||
|
||||
// Check water
|
||||
if (water)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2007-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2012-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 2012-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -24,12 +24,14 @@
|
|||
#include "../byteptr.h"
|
||||
#include "../lua_script.h"
|
||||
#include "../m_misc.h"
|
||||
#include "../i_time.h"
|
||||
|
||||
|
||||
#define IO_INPUT 1
|
||||
#define IO_OUTPUT 2
|
||||
|
||||
#define FILELIMIT (1024 * 1024) // Size limit for reading/writing files
|
||||
#define MAXBYTESPERMINUTE (10 * 1024 * 1024) // Rate limit for writing files
|
||||
#define MAXOPENSPERMINUTE 50 // Rate limit for opening new files
|
||||
|
||||
#define FMT_FILECALLBACKID "file_callback_%d"
|
||||
|
||||
|
@ -46,6 +48,10 @@ static const char *whitelist[] = {
|
|||
};
|
||||
|
||||
|
||||
static INT64 numwrittenbytes = 0;
|
||||
static INT64 numopenedfiles = 0;
|
||||
|
||||
|
||||
static int pushresult (lua_State *L, int i, const char *filename) {
|
||||
int en = errno; /* calls to Lua API may change this value */
|
||||
if (i) {
|
||||
|
@ -252,6 +258,17 @@ static int io_openlocal (lua_State *L) {
|
|||
"Files can't be opened while being downloaded\n",
|
||||
filename);
|
||||
|
||||
// Reading not restricted
|
||||
if (client && (strchr(mode, 'w') || strchr(mode, 'a') || strchr(mode, '+')))
|
||||
{
|
||||
if (numopenedfiles >= (I_GetTime() / (60*TICRATE) + 1) * MAXOPENSPERMINUTE)
|
||||
I_Error("Access denied to %s\n"
|
||||
"File opening rate exceeded\n",
|
||||
filename);
|
||||
|
||||
numopenedfiles++;
|
||||
}
|
||||
|
||||
MakePathDirs(realfilename);
|
||||
|
||||
// Open and return the file
|
||||
|
@ -527,9 +544,12 @@ static int g_write (lua_State *L, FILE *f, int arg) {
|
|||
else {
|
||||
size_t l;
|
||||
const char *s = luaL_checklstring(L, arg, &l);
|
||||
if (ftell(f) + l > FILELIMIT) {
|
||||
luaL_error(L,"write limit bypassed in file. Changes have been discarded.");
|
||||
break;
|
||||
if (client) {
|
||||
if (numwrittenbytes + l > (I_GetTime() / (60*TICRATE) + 1) * MAXBYTESPERMINUTE) {
|
||||
luaL_error(L,"file write rate limit exceeded; changes have been discarded");
|
||||
break;
|
||||
}
|
||||
numwrittenbytes += l;
|
||||
}
|
||||
status = status && (fwrite(s, sizeof(char), l, f) == l);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -34,6 +34,7 @@
|
|||
#include "lua_script.h"
|
||||
#include "d_netfil.h" // findfile
|
||||
#include "r_data.h" // Color_cons_t
|
||||
#include "d_main.h" // D_IsPathAllowed
|
||||
|
||||
//========
|
||||
// protos.
|
||||
|
@ -57,6 +58,7 @@ static boolean CV_FilterVarByVersion(consvar_t *v, const char *valstr);
|
|||
static boolean CV_Command(void);
|
||||
consvar_t *CV_FindVar(const char *name);
|
||||
static const char *CV_StringValue(const char *var_name);
|
||||
static boolean CV_Immutable(const consvar_t *var);
|
||||
|
||||
static consvar_t *consvar_vars; // list of registered console variables
|
||||
static UINT16 consvar_number_of_netids = 0;
|
||||
|
@ -108,6 +110,7 @@ static cmdalias_t *com_alias; // aliases list
|
|||
// =========================================================================
|
||||
|
||||
static vsbuf_t com_text; // variable sized buffer
|
||||
static com_flags_t com_flags = 0;
|
||||
|
||||
/** Purges control characters out of some text.
|
||||
*
|
||||
|
@ -140,7 +143,7 @@ COM_Purge (char *s, int *np)
|
|||
* \param ptext The text to add.
|
||||
* \sa COM_BufInsertTextEx
|
||||
*/
|
||||
void COM_BufAddTextEx(const char *ptext, int flags)
|
||||
void COM_BufAddTextEx(const char *ptext, com_flags_t flags)
|
||||
{
|
||||
int l;
|
||||
char *text;
|
||||
|
@ -163,7 +166,7 @@ void COM_BufAddTextEx(const char *ptext, int flags)
|
|||
* \param ptext The text to execute. A newline is automatically added.
|
||||
* \sa COM_BufAddTextEx
|
||||
*/
|
||||
void COM_BufInsertTextEx(const char *ptext, int flags)
|
||||
void COM_BufInsertTextEx(const char *ptext, com_flags_t flags)
|
||||
{
|
||||
const INT32 old_wait = com_wait;
|
||||
|
||||
|
@ -264,6 +267,8 @@ void COM_BufExecute(void)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
com_flags = 0;
|
||||
}
|
||||
|
||||
/** Executes a string immediately. Used for skirting around WAIT commands.
|
||||
|
@ -308,6 +313,7 @@ typedef struct xcommand_s
|
|||
const char *name;
|
||||
struct xcommand_s *next;
|
||||
com_func_t function;
|
||||
com_flags_t flags;
|
||||
} xcommand_t;
|
||||
|
||||
static xcommand_t *com_commands = NULL; // current commands
|
||||
|
@ -317,7 +323,6 @@ static size_t com_argc;
|
|||
static char *com_argv[MAX_ARGS];
|
||||
static const char *com_null_string = "";
|
||||
static char *com_args = NULL; // current command args or NULL
|
||||
static int com_flags;
|
||||
|
||||
static void Got_NetVar(UINT8 **p, INT32 playernum);
|
||||
|
||||
|
@ -329,16 +334,16 @@ void COM_Init(void)
|
|||
VS_Alloc(&com_text, COM_BUF_SIZE);
|
||||
|
||||
// add standard commands
|
||||
COM_AddCommand("alias", COM_Alias_f);
|
||||
COM_AddCommand("echo", COM_Echo_f);
|
||||
COM_AddCommand("cecho", COM_CEcho_f);
|
||||
COM_AddCommand("cechoflags", COM_CEchoFlags_f);
|
||||
COM_AddCommand("cechoduration", COM_CEchoDuration_f);
|
||||
COM_AddCommand("exec", COM_Exec_f);
|
||||
COM_AddCommand("wait", COM_Wait_f);
|
||||
COM_AddCommand("help", COM_Help_f);
|
||||
COM_AddCommand("toggle", COM_Toggle_f);
|
||||
COM_AddCommand("add", COM_Add_f);
|
||||
COM_AddCommand("alias", COM_Alias_f, 0);
|
||||
COM_AddCommand("echo", COM_Echo_f, COM_LUA);
|
||||
COM_AddCommand("cecho", COM_CEcho_f, COM_LUA);
|
||||
COM_AddCommand("cechoflags", COM_CEchoFlags_f, COM_LUA);
|
||||
COM_AddCommand("cechoduration", COM_CEchoDuration_f, COM_LUA);
|
||||
COM_AddCommand("exec", COM_Exec_f, 0);
|
||||
COM_AddCommand("wait", COM_Wait_f, 0);
|
||||
COM_AddCommand("help", COM_Help_f, COM_LUA);
|
||||
COM_AddCommand("toggle", COM_Toggle_f, COM_LUA);
|
||||
COM_AddCommand("add", COM_Add_f, COM_LUA);
|
||||
RegisterNetXCmd(XD_NETVAR, Got_NetVar);
|
||||
}
|
||||
|
||||
|
@ -440,7 +445,6 @@ static void COM_TokenizeString(char *ptext)
|
|||
|
||||
com_argc = 0;
|
||||
com_args = NULL;
|
||||
com_flags = 0;
|
||||
|
||||
while (com_argc < MAX_ARGS)
|
||||
{
|
||||
|
@ -478,7 +482,7 @@ static void COM_TokenizeString(char *ptext)
|
|||
* \param name Name of the command.
|
||||
* \param func Function called when the command is run.
|
||||
*/
|
||||
void COM_AddCommand(const char *name, com_func_t func)
|
||||
void COM_AddCommand(const char *name, com_func_t func, com_flags_t flags)
|
||||
{
|
||||
xcommand_t *cmd;
|
||||
|
||||
|
@ -508,6 +512,7 @@ void COM_AddCommand(const char *name, com_func_t func)
|
|||
cmd = ZZ_Alloc(sizeof *cmd);
|
||||
cmd->name = name;
|
||||
cmd->function = func;
|
||||
cmd->flags = flags;
|
||||
cmd->next = com_commands;
|
||||
com_commands = cmd;
|
||||
}
|
||||
|
@ -540,6 +545,7 @@ int COM_AddLuaCommand(const char *name)
|
|||
cmd = ZZ_Alloc(sizeof *cmd);
|
||||
cmd->name = name;
|
||||
cmd->function = COM_Lua_f;
|
||||
cmd->flags = COM_LUA;
|
||||
cmd->next = com_commands;
|
||||
com_commands = cmd;
|
||||
return 0;
|
||||
|
@ -635,6 +641,12 @@ static void COM_ExecuteString(char *ptext)
|
|||
{
|
||||
if (!stricmp(com_argv[0], cmd->name)) //case insensitive now that we have lower and uppercase!
|
||||
{
|
||||
if ((com_flags & COM_LUA) && !(cmd->flags & COM_LUA))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "Command '%s' cannot be run from Lua.\n", cmd->name);
|
||||
return;
|
||||
}
|
||||
|
||||
cmd->function();
|
||||
return;
|
||||
}
|
||||
|
@ -770,6 +782,9 @@ static void COM_Exec_f(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!D_CheckPathAllowed(COM_Argv(1), "tried to exec"))
|
||||
return;
|
||||
|
||||
// load file
|
||||
// Try with Argv passed verbatim first, for back compat
|
||||
FIL_ReadFile(COM_Argv(1), &buf);
|
||||
|
@ -794,8 +809,8 @@ static void COM_Exec_f(void)
|
|||
CONS_Printf(M_GetText("executing %s\n"), COM_Argv(1));
|
||||
|
||||
// insert text file into the command buffer
|
||||
COM_BufAddText((char *)buf);
|
||||
COM_BufAddText("\n");
|
||||
COM_BufAddTextEx((char *)buf, com_flags);
|
||||
COM_BufAddTextEx("\n", com_flags);
|
||||
|
||||
// free buffer
|
||||
Z_Free(buf);
|
||||
|
@ -998,6 +1013,9 @@ static void COM_Toggle_f(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (CV_Immutable(cvar))
|
||||
return;
|
||||
|
||||
if (!(cvar->PossibleValue == CV_YesNo || cvar->PossibleValue == CV_OnOff))
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("%s is not a boolean value\n"), COM_Argv(1));
|
||||
|
@ -1027,6 +1045,9 @@ static void COM_Add_f(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (CV_Immutable(cvar))
|
||||
return;
|
||||
|
||||
if (( cvar->flags & CV_FLOAT ))
|
||||
{
|
||||
float n =FIXED_TO_FLOAT (cvar->value) + atof(COM_Argv(2));
|
||||
|
@ -1116,7 +1137,7 @@ void VS_Write(vsbuf_t *buf, const void *data, size_t length)
|
|||
M_Memcpy(VS_GetSpace(buf, length), data, length);
|
||||
}
|
||||
|
||||
void VS_WriteEx(vsbuf_t *buf, const void *data, size_t length, int flags)
|
||||
void VS_WriteEx(vsbuf_t *buf, const void *data, size_t length, com_flags_t flags)
|
||||
{
|
||||
char *p;
|
||||
p = VS_GetSpace(buf, 2 + length);
|
||||
|
@ -2370,7 +2391,7 @@ static boolean CV_Command(void)
|
|||
if (!v)
|
||||
return false;
|
||||
|
||||
if (( com_flags & COM_SAFE ) && ( v->flags & CV_NOLUA ))
|
||||
if (CV_Immutable(v))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "Variable '%s' cannot be changed from Lua.\n", v->name);
|
||||
return true;
|
||||
|
@ -2459,6 +2480,22 @@ void CV_SaveVariables(FILE *f)
|
|||
}
|
||||
}
|
||||
|
||||
// Returns true if this cvar cannot be modified in current context.
|
||||
// Such as if the cvar does not have CV_ALLOWLUA.
|
||||
static boolean CV_Immutable(const consvar_t *var)
|
||||
{
|
||||
// Currently operating from Lua
|
||||
if (com_flags & COM_LUA)
|
||||
{
|
||||
if (!(var->flags & CV_ALLOWLUA))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
// SCRIPT PARSE
|
||||
//============================================================================
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -20,23 +20,23 @@
|
|||
// Command buffer & command execution
|
||||
//===================================
|
||||
|
||||
/* Lua command registration flags. */
|
||||
enum
|
||||
/* Command registration flags. */
|
||||
typedef enum
|
||||
{
|
||||
COM_ADMIN = 1,
|
||||
COM_SPLITSCREEN = 2,
|
||||
COM_LOCAL = 4,
|
||||
};
|
||||
|
||||
/* Command buffer flags. */
|
||||
enum
|
||||
{
|
||||
COM_SAFE = 1,
|
||||
};
|
||||
// COM_BufInsertText etc: can only access cvars
|
||||
// with CV_ALLOWLUA set.
|
||||
// COM_AddCommand: without this flag, the command
|
||||
// CANNOT be run from Lua.
|
||||
COM_LUA = 8,
|
||||
} com_flags_t;
|
||||
|
||||
typedef void (*com_func_t)(void);
|
||||
|
||||
void COM_AddCommand(const char *name, com_func_t func);
|
||||
void COM_AddCommand(const char *name, com_func_t func, com_flags_t flags);
|
||||
int COM_AddLuaCommand(const char *name);
|
||||
|
||||
size_t COM_Argc(void);
|
||||
|
@ -53,11 +53,11 @@ const char *COM_CompleteAlias(const char *partial, INT32 skips);
|
|||
|
||||
// insert at queu (at end of other command)
|
||||
#define COM_BufAddText(s) COM_BufAddTextEx(s, 0)
|
||||
void COM_BufAddTextEx(const char *btext, int flags);
|
||||
void COM_BufAddTextEx(const char *btext, com_flags_t flags);
|
||||
|
||||
// insert in head (before other command)
|
||||
#define COM_BufInsertText(s) COM_BufInsertTextEx(s, 0)
|
||||
void COM_BufInsertTextEx(const char *btext, int flags);
|
||||
void COM_BufInsertTextEx(const char *btext, com_flags_t flags);
|
||||
|
||||
// don't bother inserting, just do immediately
|
||||
void COM_ImmedExecute(const char *ptext);
|
||||
|
@ -89,7 +89,7 @@ void VS_Free(vsbuf_t *buf);
|
|||
void VS_Clear(vsbuf_t *buf);
|
||||
void *VS_GetSpace(vsbuf_t *buf, size_t length);
|
||||
void VS_Write(vsbuf_t *buf, const void *data, size_t length);
|
||||
void VS_WriteEx(vsbuf_t *buf, const void *data, size_t length, int flags);
|
||||
void VS_WriteEx(vsbuf_t *buf, const void *data, size_t length, com_flags_t flags);
|
||||
void VS_Print(vsbuf_t *buf, const char *data); // strcats onto the sizebuf
|
||||
|
||||
//==================
|
||||
|
@ -120,7 +120,7 @@ typedef enum
|
|||
// can only be set when we have the pointer to it
|
||||
// used on menus
|
||||
CV_CHEAT = 2048, // Don't let this be used in multiplayer unless cheats are on.
|
||||
CV_NOLUA = 4096,/* don't let this be called from Lua */
|
||||
CV_ALLOWLUA = 4096,/* Let this be called from Lua */
|
||||
} cvflags_t;
|
||||
|
||||
typedef struct CV_PossibleValue_s
|
||||
|
|
|
@ -27,12 +27,13 @@
|
|||
* Last updated 2020 / 10 / 02 - v2.2.8 - patch.pk3
|
||||
* Last updated 2021 / 05 / 06 - v2.2.9 - patch.pk3 & zones.pk3
|
||||
* Last updated 2022 / 03 / 06 - v2.2.10 - main assets
|
||||
* Last updated 2023 / 05 / 02 - v2.2.11 - patch.pk3 & zones.pk3
|
||||
*/
|
||||
#define ASSET_HASH_SRB2_PK3 "ad911f29a28a18968ee5b2d11c2acb39"
|
||||
#define ASSET_HASH_ZONES_PK3 "86ae55cae4e0a93ceda868635706a093"
|
||||
#define ASSET_HASH_ZONES_PK3 "1c8adf8d079ecb87d00081f158acf3c7"
|
||||
#define ASSET_HASH_PLAYER_DTA "2e7aaae8a6b1b77d90ffe7606ceadb6c"
|
||||
#ifdef USE_PATCH_DTA
|
||||
#define ASSET_HASH_PATCH_PK3 "7d467a883f7887b3c311798ee2f56b6a"
|
||||
#define ASSET_HASH_PATCH_PK3 "2e69558bce3b9610624549a75e29e19b"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
107
src/console.c
107
src/console.c
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -61,7 +61,7 @@ static boolean con_started = false; // console has been initialised
|
|||
static boolean con_forcepic = true; // at startup toggle console translucency when first off
|
||||
boolean con_recalc; // set true when screen size has changed
|
||||
|
||||
static tic_t con_tick; // console ticker for anim or blinking prompt cursor
|
||||
static tic_t con_tick; // console ticker for blinking prompt cursor
|
||||
// con_scrollup should use time (currenttime - lasttime)..
|
||||
|
||||
static boolean consoletoggle; // true when console key pushed, ticker will handle
|
||||
|
@ -110,6 +110,7 @@ static void CON_RecalcSize(void);
|
|||
static void CON_ChangeHeight(void);
|
||||
|
||||
static void CON_DrawBackpic(void);
|
||||
static void CONS_height_Change(void);
|
||||
static void CONS_hudlines_Change(void);
|
||||
static void CONS_backcolor_Change(void);
|
||||
|
||||
|
@ -136,7 +137,7 @@ static CV_PossibleValue_t speed_cons_t[] = {{0, "MIN"}, {64, "MAX"}, {0, NULL}};
|
|||
static consvar_t cons_speed = CVAR_INIT ("con_speed", "8", CV_SAVE, speed_cons_t, NULL);
|
||||
|
||||
// percentage of screen height to use for console
|
||||
static consvar_t cons_height = CVAR_INIT ("con_height", "50", CV_SAVE, CV_Unsigned, NULL);
|
||||
static consvar_t cons_height = CVAR_INIT ("con_height", "50", CV_CALL|CV_SAVE, CV_Unsigned, CONS_height_Change);
|
||||
|
||||
static CV_PossibleValue_t backpic_cons_t[] = {{0, "translucent"}, {1, "picture"}, {0, NULL}};
|
||||
// whether to use console background picture, or translucent mode
|
||||
|
@ -156,6 +157,18 @@ consvar_t cons_backcolor = CVAR_INIT ("con_backcolor", "Green", CV_CALL|CV_SAVE,
|
|||
|
||||
static void CON_Print(char *msg);
|
||||
|
||||
// Change the console height on demand
|
||||
//
|
||||
static void CONS_height_Change(void)
|
||||
{
|
||||
Lock_state();
|
||||
|
||||
if (con_destlines > 0 && !con_startup) // If the console is open (as in, not using "bind")...
|
||||
CON_ChangeHeight(); // ...update its height now, not only when it's closed and re-opened
|
||||
|
||||
Unlock_state();
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
static void CONS_hudlines_Change(void)
|
||||
|
@ -443,7 +456,7 @@ void CON_Init(void)
|
|||
|
||||
// register our commands
|
||||
//
|
||||
COM_AddCommand("cls", CONS_Clear_f);
|
||||
COM_AddCommand("cls", CONS_Clear_f, 0);
|
||||
//COM_AddCommand("english", CONS_English_f);
|
||||
// set console full screen for game startup MAKE SURE VID_Init() done !!!
|
||||
Lock_state();
|
||||
|
@ -470,7 +483,7 @@ void CON_Init(void)
|
|||
CV_RegisterVar(&cons_height);
|
||||
CV_RegisterVar(&cons_backpic);
|
||||
CV_RegisterVar(&cons_backcolor);
|
||||
COM_AddCommand("bind", CONS_Bind_f);
|
||||
COM_AddCommand("bind", CONS_Bind_f, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -643,33 +656,39 @@ static void CON_ChangeHeight(void)
|
|||
//
|
||||
static void CON_MoveConsole(void)
|
||||
{
|
||||
fixed_t conspeed;
|
||||
static fixed_t fracmovement = 0;
|
||||
|
||||
Lock_state();
|
||||
|
||||
conspeed = FixedDiv(cons_speed.value*vid.fdupy, FRACUNIT);
|
||||
|
||||
// instant
|
||||
if (!cons_speed.value)
|
||||
{
|
||||
con_curlines = con_destlines;
|
||||
Unlock_state();
|
||||
return;
|
||||
}
|
||||
|
||||
// up/down move to dest
|
||||
if (con_curlines < con_destlines)
|
||||
// Not instant - Increment fracmovement fractionally
|
||||
fracmovement += FixedMul(cons_speed.value*vid.fdupy, renderdeltatics);
|
||||
|
||||
if (con_curlines < con_destlines) // Move the console downwards
|
||||
{
|
||||
con_curlines += FixedInt(conspeed);
|
||||
if (con_curlines > con_destlines)
|
||||
con_curlines = con_destlines;
|
||||
con_curlines += FixedInt(fracmovement); // Move by fracmovement's integer value
|
||||
if (con_curlines > con_destlines) // If we surpassed the destination...
|
||||
con_curlines = con_destlines; // ...clamp to it!
|
||||
}
|
||||
else if (con_curlines > con_destlines)
|
||||
else // Move the console upwards
|
||||
{
|
||||
con_curlines -= FixedInt(conspeed);
|
||||
con_curlines -= FixedInt(fracmovement);
|
||||
if (con_curlines < con_destlines)
|
||||
con_curlines = con_destlines;
|
||||
|
||||
if (con_destlines == 0) // If the console is being closed, not just moved up...
|
||||
con_tick = 0; // ...don't show the blinking cursor
|
||||
}
|
||||
|
||||
fracmovement %= FRACUNIT; // Reset fracmovement's integer value, but keep the fraction
|
||||
|
||||
Unlock_state();
|
||||
}
|
||||
|
||||
|
@ -752,10 +771,6 @@ void CON_Ticker(void)
|
|||
CON_ChangeHeight();
|
||||
}
|
||||
|
||||
// console movement
|
||||
if (con_destlines != con_curlines)
|
||||
CON_MoveConsole();
|
||||
|
||||
// clip the view, so that the part under the console is not drawn
|
||||
con_clipviewtop = -1;
|
||||
if (cons_backpic.value) // clip only when using an opaque background
|
||||
|
@ -1809,41 +1824,41 @@ static void CON_DrawConsole(void)
|
|||
}
|
||||
|
||||
// draw console text lines from top to bottom
|
||||
if (con_curlines < minheight)
|
||||
return;
|
||||
|
||||
i = con_cy - con_scrollup;
|
||||
|
||||
// skip the last empty line due to the cursor being at the start of a new line
|
||||
i--;
|
||||
|
||||
i -= (con_curlines - minheight) / charheight;
|
||||
|
||||
if (rendermode == render_none) return;
|
||||
|
||||
for (y = (con_curlines-minheight) % charheight; y <= con_curlines-minheight; y += charheight, i++)
|
||||
if (con_curlines >= minheight)
|
||||
{
|
||||
INT32 x;
|
||||
size_t c;
|
||||
i = con_cy - con_scrollup;
|
||||
|
||||
p = (UINT8 *)&con_buffer[((i > 0 ? i : 0)%con_totallines)*con_width];
|
||||
// skip the last empty line due to the cursor being at the start of a new line
|
||||
i--;
|
||||
|
||||
for (c = 0, x = charwidth; c < con_width; c++, x += charwidth, p++)
|
||||
i -= (con_curlines - minheight) / charheight;
|
||||
|
||||
if (rendermode == render_none) return;
|
||||
|
||||
for (y = (con_curlines-minheight) % charheight; y <= con_curlines-minheight; y += charheight, i++)
|
||||
{
|
||||
while (*p & 0x80)
|
||||
INT32 x;
|
||||
size_t c;
|
||||
|
||||
p = (UINT8 *)&con_buffer[((i > 0 ? i : 0)%con_totallines)*con_width];
|
||||
|
||||
for (c = 0, x = charwidth; c < con_width; c++, x += charwidth, p++)
|
||||
{
|
||||
charflags = (*p & 0x7f) << V_CHARCOLORSHIFT;
|
||||
p++;
|
||||
c++;
|
||||
while (*p & 0x80)
|
||||
{
|
||||
charflags = (*p & 0x7f) << V_CHARCOLORSHIFT;
|
||||
p++;
|
||||
c++;
|
||||
}
|
||||
if (c >= con_width)
|
||||
break;
|
||||
V_DrawCharacter(x, y, (INT32)(*p) | charflags | cv_constextsize.value | V_NOSCALESTART, true);
|
||||
}
|
||||
if (c >= con_width)
|
||||
break;
|
||||
V_DrawCharacter(x, y, (INT32)(*p) | charflags | cv_constextsize.value | V_NOSCALESTART, true);
|
||||
}
|
||||
}
|
||||
|
||||
// draw prompt if enough place (not while game startup)
|
||||
if ((con_curlines == con_destlines) && (con_curlines >= minheight) && !con_startup)
|
||||
if ((con_curlines >= (minheight-charheight)) && !con_startup)
|
||||
CON_DrawInput();
|
||||
}
|
||||
|
||||
|
@ -1866,6 +1881,10 @@ void CON_Drawer(void)
|
|||
CON_ClearHUD();
|
||||
}
|
||||
|
||||
// console movement
|
||||
if (con_curlines != con_destlines)
|
||||
CON_MoveConsole();
|
||||
|
||||
if (con_curlines > 0)
|
||||
CON_DrawConsole();
|
||||
else if (gamestate == GS_LEVEL
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -1377,8 +1377,9 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
|
|||
netbuffer->u.serverinfo.time = (tic_t)LONG(servertime);
|
||||
netbuffer->u.serverinfo.leveltime = (tic_t)LONG(leveltime);
|
||||
|
||||
netbuffer->u.serverinfo.numberofplayer = (UINT8)D_NumPlayers();
|
||||
netbuffer->u.serverinfo.maxplayer = (UINT8)cv_maxplayers.value;
|
||||
// Exclude bots from both counts
|
||||
netbuffer->u.serverinfo.numberofplayer = (UINT8)(D_NumPlayers() - D_NumBots());
|
||||
netbuffer->u.serverinfo.maxplayer = (UINT8)(cv_maxplayers.value - D_NumBots());
|
||||
|
||||
netbuffer->u.serverinfo.refusereason = GetRefuseReason(node);
|
||||
|
||||
|
@ -1505,6 +1506,7 @@ static boolean SV_SendServerConfig(INT32 node)
|
|||
netbuffer->u.servercfg.gamestate = (UINT8)gamestate;
|
||||
netbuffer->u.servercfg.gametype = (UINT8)gametype;
|
||||
netbuffer->u.servercfg.modifiedgame = (UINT8)modifiedgame;
|
||||
netbuffer->u.servercfg.usedCheats = (UINT8)usedCheats;
|
||||
|
||||
memcpy(netbuffer->u.servercfg.server_context, server_context, 8);
|
||||
|
||||
|
@ -3506,10 +3508,10 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
|
|||
static CV_PossibleValue_t netticbuffer_cons_t[] = {{0, "MIN"}, {3, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_netticbuffer = CVAR_INIT ("netticbuffer", "1", CV_SAVE, netticbuffer_cons_t, NULL);
|
||||
|
||||
consvar_t cv_allownewplayer = CVAR_INIT ("allowjoin", "On", CV_SAVE|CV_NETVAR, CV_OnOff, NULL);
|
||||
consvar_t cv_allownewplayer = CVAR_INIT ("allowjoin", "On", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, CV_OnOff, NULL);
|
||||
consvar_t cv_joinnextround = CVAR_INIT ("joinnextround", "Off", CV_SAVE|CV_NETVAR, CV_OnOff, NULL); /// \todo not done
|
||||
static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {32, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_maxplayers = CVAR_INIT ("maxplayers", "8", CV_SAVE|CV_NETVAR, maxplayers_cons_t, NULL);
|
||||
consvar_t cv_maxplayers = CVAR_INIT ("maxplayers", "8", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, maxplayers_cons_t, NULL);
|
||||
static CV_PossibleValue_t joindelay_cons_t[] = {{1, "MIN"}, {3600, "MAX"}, {0, "Off"}, {0, NULL}};
|
||||
consvar_t cv_joindelay = CVAR_INIT ("joindelay", "10", CV_SAVE|CV_NETVAR, joindelay_cons_t, NULL);
|
||||
static CV_PossibleValue_t rejointimeout_cons_t[] = {{1, "MIN"}, {60 * FRACUNIT, "MAX"}, {0, "Off"}, {0, NULL}};
|
||||
|
@ -3537,22 +3539,22 @@ void D_ClientServerInit(void)
|
|||
VERSION/100, VERSION%100, SUBVERSION));
|
||||
|
||||
#ifndef NONET
|
||||
COM_AddCommand("getplayernum", Command_GetPlayerNum);
|
||||
COM_AddCommand("kick", Command_Kick);
|
||||
COM_AddCommand("ban", Command_Ban);
|
||||
COM_AddCommand("banip", Command_BanIP);
|
||||
COM_AddCommand("clearbans", Command_ClearBans);
|
||||
COM_AddCommand("showbanlist", Command_ShowBan);
|
||||
COM_AddCommand("reloadbans", Command_ReloadBan);
|
||||
COM_AddCommand("connect", Command_connect);
|
||||
COM_AddCommand("nodes", Command_Nodes);
|
||||
COM_AddCommand("resendgamestate", Command_ResendGamestate);
|
||||
COM_AddCommand("getplayernum", Command_GetPlayerNum, COM_LUA);
|
||||
COM_AddCommand("kick", Command_Kick, COM_LUA);
|
||||
COM_AddCommand("ban", Command_Ban, COM_LUA);
|
||||
COM_AddCommand("banip", Command_BanIP, COM_LUA);
|
||||
COM_AddCommand("clearbans", Command_ClearBans, COM_LUA);
|
||||
COM_AddCommand("showbanlist", Command_ShowBan, COM_LUA);
|
||||
COM_AddCommand("reloadbans", Command_ReloadBan, COM_LUA);
|
||||
COM_AddCommand("connect", Command_connect, COM_LUA);
|
||||
COM_AddCommand("nodes", Command_Nodes, COM_LUA);
|
||||
COM_AddCommand("resendgamestate", Command_ResendGamestate, COM_LUA);
|
||||
#ifdef PACKETDROP
|
||||
COM_AddCommand("drop", Command_Drop);
|
||||
COM_AddCommand("droprate", Command_Droprate);
|
||||
COM_AddCommand("drop", Command_Drop, COM_LUA);
|
||||
COM_AddCommand("droprate", Command_Droprate, COM_LUA);
|
||||
#endif
|
||||
#ifdef _DEBUG
|
||||
COM_AddCommand("numnodes", Command_Numnodes);
|
||||
COM_AddCommand("numnodes", Command_Numnodes, COM_LUA);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -4077,7 +4079,7 @@ ConnectionRefused (SINT8 node, INT32 rejoinernum)
|
|||
{
|
||||
return va(
|
||||
"Maximum players reached: %d",
|
||||
cv_maxplayers.value);
|
||||
cv_maxplayers.value - D_NumBots());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4405,6 +4407,8 @@ static void HandlePacketFromAwayNode(SINT8 node)
|
|||
maketic = gametic = neededtic = (tic_t)LONG(netbuffer->u.servercfg.gametic);
|
||||
G_SetGametype(netbuffer->u.servercfg.gametype);
|
||||
modifiedgame = netbuffer->u.servercfg.modifiedgame;
|
||||
if (netbuffer->u.servercfg.usedCheats)
|
||||
G_SetUsedCheats(true);
|
||||
memcpy(server_context, netbuffer->u.servercfg.server_context, 8);
|
||||
}
|
||||
|
||||
|
@ -5609,6 +5613,19 @@ INT32 D_NumPlayers(void)
|
|||
return num;
|
||||
}
|
||||
|
||||
/** Similar to the above, but counts only bots.
|
||||
* Purpose is to remove bots from both the player count and the
|
||||
* max player count on the server view
|
||||
*/
|
||||
INT32 D_NumBots(void)
|
||||
{
|
||||
INT32 num = 0, ix;
|
||||
for (ix = 0; ix < MAXPLAYERS; ix++)
|
||||
if (playeringame[ix] && players[ix].bot)
|
||||
num++;
|
||||
return num;
|
||||
}
|
||||
|
||||
tic_t GetLag(INT32 node)
|
||||
{
|
||||
return gametic - nettics[node];
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -158,6 +158,7 @@ typedef struct
|
|||
|
||||
UINT8 gametype;
|
||||
UINT8 modifiedgame;
|
||||
UINT8 usedCheats;
|
||||
|
||||
char server_context[8]; // Unique context id, generated at server startup.
|
||||
} ATTRPACK serverconfig_pak;
|
||||
|
@ -447,6 +448,7 @@ extern char motd[254], server_context[8];
|
|||
extern UINT8 playernode[MAXPLAYERS];
|
||||
|
||||
INT32 D_NumPlayers(void);
|
||||
INT32 D_NumBots(void);
|
||||
void D_ResetTiccmds(void);
|
||||
|
||||
tic_t GetLag(INT32 node);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
94
src/d_main.c
94
src/d_main.c
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -1224,7 +1224,7 @@ void D_SRB2Main(void)
|
|||
// Print GPL notice for our console users (Linux)
|
||||
CONS_Printf(
|
||||
"\n\nSonic Robo Blast 2\n"
|
||||
"Copyright (C) 1998-2022 by Sonic Team Junior\n\n"
|
||||
"Copyright (C) 1998-2023 by Sonic Team Junior\n\n"
|
||||
"This program comes with ABSOLUTELY NO WARRANTY.\n\n"
|
||||
"This is free software, and you are welcome to redistribute it\n"
|
||||
"and/or modify it under the terms of the GNU General Public License\n"
|
||||
|
@ -1473,6 +1473,12 @@ void D_SRB2Main(void)
|
|||
//--------------------------------------------------------- CONFIG.CFG
|
||||
M_FirstLoadConfig(); // WARNING : this do a "COM_BufExecute()"
|
||||
|
||||
if (M_CheckParm("-gamedata") && M_IsNextParm())
|
||||
{
|
||||
// Moved from G_LoadGameData itself, as it would cause some crazy
|
||||
// confusion issues when loading mods.
|
||||
strlcpy(gamedatafilename, M_GetNextParm(), sizeof gamedatafilename);
|
||||
}
|
||||
G_LoadGameData();
|
||||
|
||||
#if defined (__unix__) || defined (UNIXCOMMON) || defined (HAVE_SDL)
|
||||
|
@ -1500,7 +1506,7 @@ void D_SRB2Main(void)
|
|||
else
|
||||
{
|
||||
if (!M_CheckParm("-server"))
|
||||
G_SetGameModified(true);
|
||||
G_SetUsedCheats(true);
|
||||
autostart = true;
|
||||
}
|
||||
}
|
||||
|
@ -1777,3 +1783,85 @@ const char *D_Home(void)
|
|||
if (usehome) return userhome;
|
||||
else return NULL;
|
||||
}
|
||||
|
||||
static boolean check_top_dir(const char **path, const char *top)
|
||||
{
|
||||
// empty string does NOT match
|
||||
if (!strcmp(top, ""))
|
||||
return false;
|
||||
|
||||
if (!startswith(*path, top))
|
||||
return false;
|
||||
|
||||
*path += strlen(top);
|
||||
|
||||
// if it doesn't already end with a path separator,
|
||||
// check if a separator follows
|
||||
if (!endswith(top, PATHSEP))
|
||||
{
|
||||
if (startswith(*path, PATHSEP))
|
||||
*path += strlen(PATHSEP);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static int cmp_strlen_desc(const void *a, const void *b)
|
||||
{
|
||||
return ((int)strlen(*(const char*const*)b) - (int)strlen(*(const char*const*)a));
|
||||
}
|
||||
|
||||
boolean D_IsPathAllowed(const char *path)
|
||||
{
|
||||
const char *paths[] = {
|
||||
srb2home,
|
||||
srb2path,
|
||||
cv_addons_folder.string
|
||||
};
|
||||
|
||||
const size_t n_paths = sizeof paths / sizeof *paths;
|
||||
|
||||
size_t i;
|
||||
|
||||
// Sort folder paths by longest to shortest so
|
||||
// overlapping paths work. E.g.:
|
||||
// Path 1: /home/james/.srb2/addons
|
||||
// Path 2: /home/james/.srb2
|
||||
qsort(paths, n_paths, sizeof *paths, cmp_strlen_desc);
|
||||
|
||||
// These paths are allowed to be absolute
|
||||
// path is offset so ".." can be checked only in the
|
||||
// rest of the path
|
||||
for (i = 0; i < n_paths; ++i)
|
||||
{
|
||||
if (check_top_dir(&path, paths[i]))
|
||||
break;
|
||||
}
|
||||
|
||||
// Only if none of the presets matched
|
||||
if (i == n_paths)
|
||||
{
|
||||
// Cannot be an absolute path
|
||||
if (M_IsPathAbsolute(path))
|
||||
return false;
|
||||
}
|
||||
|
||||
// Cannot traverse upwards
|
||||
if (strstr(path, ".."))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean D_CheckPathAllowed(const char *path, const char *why)
|
||||
{
|
||||
if (!D_IsPathAllowed(path))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "%s: %s, location is not allowed\n", why, path);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -44,6 +44,9 @@ void D_ProcessEvents(void);
|
|||
|
||||
const char *D_Home(void);
|
||||
|
||||
boolean D_IsPathAllowed(const char *path);
|
||||
boolean D_CheckPathAllowed(const char *path, const char *why);
|
||||
|
||||
//
|
||||
// BASE LEVEL
|
||||
//
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
290
src/d_netcmd.c
290
src/d_netcmd.c
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -203,37 +203,37 @@ static CV_PossibleValue_t matchboxes_cons_t[] = {{0, "Normal"}, {1, "Mystery"},
|
|||
static CV_PossibleValue_t chances_cons_t[] = {{0, "MIN"}, {9, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t pause_cons_t[] = {{0, "Server"}, {1, "All"}, {0, NULL}};
|
||||
|
||||
consvar_t cv_showinputjoy = CVAR_INIT ("showinputjoy", "Off", 0, CV_OnOff, NULL);
|
||||
consvar_t cv_showinputjoy = CVAR_INIT ("showinputjoy", "Off", CV_ALLOWLUA, CV_OnOff, NULL);
|
||||
|
||||
#ifdef NETGAME_DEVMODE
|
||||
static consvar_t cv_fishcake = CVAR_INIT ("fishcake", "Off", CV_CALL|CV_NOSHOWHELP|CV_RESTRICT, CV_OnOff, Fishcake_OnChange);
|
||||
#endif
|
||||
static consvar_t cv_dummyconsvar = CVAR_INIT ("dummyconsvar", "Off", CV_CALL|CV_NOSHOWHELP, CV_OnOff, DummyConsvar_OnChange);
|
||||
|
||||
consvar_t cv_restrictskinchange = CVAR_INIT ("restrictskinchange", "Yes", CV_SAVE|CV_NETVAR|CV_CHEAT, CV_YesNo, NULL);
|
||||
consvar_t cv_allowteamchange = CVAR_INIT ("allowteamchange", "Yes", CV_SAVE|CV_NETVAR, CV_YesNo, NULL);
|
||||
consvar_t cv_restrictskinchange = CVAR_INIT ("restrictskinchange", "Yes", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, CV_YesNo, NULL);
|
||||
consvar_t cv_allowteamchange = CVAR_INIT ("allowteamchange", "Yes", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, CV_YesNo, NULL);
|
||||
|
||||
consvar_t cv_startinglives = CVAR_INIT ("startinglives", "3", CV_SAVE|CV_NETVAR|CV_CHEAT, startingliveslimit_cons_t, NULL);
|
||||
consvar_t cv_startinglives = CVAR_INIT ("startinglives", "3", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, startingliveslimit_cons_t, NULL);
|
||||
|
||||
static CV_PossibleValue_t respawntime_cons_t[] = {{1, "MIN"}, {30, "MAX"}, {0, "Off"}, {0, NULL}};
|
||||
consvar_t cv_respawntime = CVAR_INIT ("respawndelay", "3", CV_SAVE|CV_NETVAR|CV_CHEAT, respawntime_cons_t, NULL);
|
||||
consvar_t cv_respawntime = CVAR_INIT ("respawndelay", "3", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, respawntime_cons_t, NULL);
|
||||
|
||||
consvar_t cv_competitionboxes = CVAR_INIT ("competitionboxes", "Mystery", CV_SAVE|CV_NETVAR|CV_CHEAT, competitionboxes_cons_t, NULL);
|
||||
consvar_t cv_competitionboxes = CVAR_INIT ("competitionboxes", "Mystery", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, competitionboxes_cons_t, NULL);
|
||||
|
||||
static CV_PossibleValue_t seenames_cons_t[] = {{0, "Off"}, {1, "Colorless"}, {2, "Team"}, {3, "Ally/Foe"}, {0, NULL}};
|
||||
consvar_t cv_seenames = CVAR_INIT ("seenames", "Ally/Foe", CV_SAVE, seenames_cons_t, 0);
|
||||
consvar_t cv_allowseenames = CVAR_INIT ("allowseenames", "Yes", CV_SAVE|CV_NETVAR, CV_YesNo, NULL);
|
||||
consvar_t cv_seenames = CVAR_INIT ("seenames", "Ally/Foe", CV_SAVE|CV_ALLOWLUA, seenames_cons_t, 0);
|
||||
consvar_t cv_allowseenames = CVAR_INIT ("allowseenames", "Yes", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, CV_YesNo, NULL);
|
||||
|
||||
// names
|
||||
consvar_t cv_playername = CVAR_INIT ("name", "Sonic", CV_SAVE|CV_CALL|CV_NOINIT, NULL, Name_OnChange);
|
||||
consvar_t cv_playername2 = CVAR_INIT ("name2", "Tails", CV_SAVE|CV_CALL|CV_NOINIT, NULL, Name2_OnChange);
|
||||
// player colors
|
||||
UINT16 lastgoodcolor = SKINCOLOR_BLUE, lastgoodcolor2 = SKINCOLOR_BLUE;
|
||||
consvar_t cv_playercolor = CVAR_INIT ("color", "Blue", CV_CALL|CV_NOINIT, Color_cons_t, Color_OnChange);
|
||||
consvar_t cv_playercolor2 = CVAR_INIT ("color2", "Orange", CV_CALL|CV_NOINIT, Color_cons_t, Color2_OnChange);
|
||||
consvar_t cv_playercolor = CVAR_INIT ("color", "Blue", CV_CALL|CV_NOINIT|CV_ALLOWLUA, Color_cons_t, Color_OnChange);
|
||||
consvar_t cv_playercolor2 = CVAR_INIT ("color2", "Orange", CV_CALL|CV_NOINIT|CV_ALLOWLUA, Color_cons_t, Color2_OnChange);
|
||||
// player's skin, saved for commodity, when using a favorite skins wad..
|
||||
consvar_t cv_skin = CVAR_INIT ("skin", DEFAULTSKIN, CV_CALL|CV_NOINIT, NULL, Skin_OnChange);
|
||||
consvar_t cv_skin2 = CVAR_INIT ("skin2", DEFAULTSKIN2, CV_CALL|CV_NOINIT, NULL, Skin2_OnChange);
|
||||
consvar_t cv_skin = CVAR_INIT ("skin", DEFAULTSKIN, CV_CALL|CV_NOINIT|CV_ALLOWLUA, NULL, Skin_OnChange);
|
||||
consvar_t cv_skin2 = CVAR_INIT ("skin2", DEFAULTSKIN2, CV_CALL|CV_NOINIT|CV_ALLOWLUA, NULL, Skin2_OnChange);
|
||||
|
||||
// saved versions of the above six
|
||||
consvar_t cv_defaultplayercolor = CVAR_INIT ("defaultcolor", "Blue", CV_SAVE, Color_cons_t, NULL);
|
||||
|
@ -268,43 +268,43 @@ consvar_t cv_mouse2opt = CVAR_INIT ("mouse2opt", "0", CV_SAVE, NULL, NULL);
|
|||
consvar_t cv_mouse2port = CVAR_INIT ("mouse2port", "COM2", CV_SAVE, mouse2port_cons_t, NULL);
|
||||
#endif
|
||||
|
||||
consvar_t cv_matchboxes = CVAR_INIT ("matchboxes", "Normal", CV_SAVE|CV_NETVAR|CV_CHEAT, matchboxes_cons_t, NULL);
|
||||
consvar_t cv_specialrings = CVAR_INIT ("specialrings", "On", CV_SAVE|CV_NETVAR, CV_OnOff, NULL);
|
||||
consvar_t cv_powerstones = CVAR_INIT ("powerstones", "On", CV_SAVE|CV_NETVAR, CV_OnOff, NULL);
|
||||
consvar_t cv_matchboxes = CVAR_INIT ("matchboxes", "Normal", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, matchboxes_cons_t, NULL);
|
||||
consvar_t cv_specialrings = CVAR_INIT ("specialrings", "On", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, CV_OnOff, NULL);
|
||||
consvar_t cv_powerstones = CVAR_INIT ("powerstones", "On", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, CV_OnOff, NULL);
|
||||
|
||||
consvar_t cv_recycler = CVAR_INIT ("tv_recycler", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL);
|
||||
consvar_t cv_teleporters = CVAR_INIT ("tv_teleporter", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL);
|
||||
consvar_t cv_superring = CVAR_INIT ("tv_superring", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL);
|
||||
consvar_t cv_supersneakers = CVAR_INIT ("tv_supersneaker", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL);
|
||||
consvar_t cv_invincibility = CVAR_INIT ("tv_invincibility", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL);
|
||||
consvar_t cv_jumpshield = CVAR_INIT ("tv_jumpshield", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL);
|
||||
consvar_t cv_watershield = CVAR_INIT ("tv_watershield", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL);
|
||||
consvar_t cv_ringshield = CVAR_INIT ("tv_ringshield", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL);
|
||||
consvar_t cv_forceshield = CVAR_INIT ("tv_forceshield", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL);
|
||||
consvar_t cv_bombshield = CVAR_INIT ("tv_bombshield", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL);
|
||||
consvar_t cv_1up = CVAR_INIT ("tv_1up", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL);
|
||||
consvar_t cv_eggmanbox = CVAR_INIT ("tv_eggman", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL);
|
||||
consvar_t cv_recycler = CVAR_INIT ("tv_recycler", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL);
|
||||
consvar_t cv_teleporters = CVAR_INIT ("tv_teleporter", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL);
|
||||
consvar_t cv_superring = CVAR_INIT ("tv_superring", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL);
|
||||
consvar_t cv_supersneakers = CVAR_INIT ("tv_supersneaker", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL);
|
||||
consvar_t cv_invincibility = CVAR_INIT ("tv_invincibility", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL);
|
||||
consvar_t cv_jumpshield = CVAR_INIT ("tv_jumpshield", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL);
|
||||
consvar_t cv_watershield = CVAR_INIT ("tv_watershield", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL);
|
||||
consvar_t cv_ringshield = CVAR_INIT ("tv_ringshield", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL);
|
||||
consvar_t cv_forceshield = CVAR_INIT ("tv_forceshield", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL);
|
||||
consvar_t cv_bombshield = CVAR_INIT ("tv_bombshield", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL);
|
||||
consvar_t cv_1up = CVAR_INIT ("tv_1up", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL);
|
||||
consvar_t cv_eggmanbox = CVAR_INIT ("tv_eggman", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL);
|
||||
|
||||
consvar_t cv_ringslinger = CVAR_INIT ("ringslinger", "No", CV_NETVAR|CV_NOSHOWHELP|CV_CALL|CV_CHEAT, CV_YesNo, Ringslinger_OnChange);
|
||||
consvar_t cv_gravity = CVAR_INIT ("gravity", "0.5", CV_RESTRICT|CV_FLOAT|CV_CALL, NULL, Gravity_OnChange);
|
||||
consvar_t cv_ringslinger = CVAR_INIT ("ringslinger", "No", CV_NETVAR|CV_NOSHOWHELP|CV_CALL|CV_CHEAT|CV_ALLOWLUA, CV_YesNo, Ringslinger_OnChange);
|
||||
consvar_t cv_gravity = CVAR_INIT ("gravity", "0.5", CV_RESTRICT|CV_FLOAT|CV_CALL|CV_ALLOWLUA, NULL, Gravity_OnChange);
|
||||
|
||||
consvar_t cv_soundtest = CVAR_INIT ("soundtest", "0", CV_CALL, NULL, SoundTest_OnChange);
|
||||
|
||||
static CV_PossibleValue_t minitimelimit_cons_t[] = {{1, "MIN"}, {9999, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_countdowntime = CVAR_INIT ("countdowntime", "60", CV_SAVE|CV_NETVAR|CV_CHEAT, minitimelimit_cons_t, NULL);
|
||||
consvar_t cv_countdowntime = CVAR_INIT ("countdowntime", "60", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, minitimelimit_cons_t, NULL);
|
||||
|
||||
consvar_t cv_touchtag = CVAR_INIT ("touchtag", "Off", CV_SAVE|CV_NETVAR, CV_OnOff, NULL);
|
||||
consvar_t cv_hidetime = CVAR_INIT ("hidetime", "30", CV_SAVE|CV_NETVAR|CV_CALL, minitimelimit_cons_t, Hidetime_OnChange);
|
||||
consvar_t cv_touchtag = CVAR_INIT ("touchtag", "Off", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, CV_OnOff, NULL);
|
||||
consvar_t cv_hidetime = CVAR_INIT ("hidetime", "30", CV_SAVE|CV_NETVAR|CV_CALL|CV_ALLOWLUA, minitimelimit_cons_t, Hidetime_OnChange);
|
||||
|
||||
consvar_t cv_autobalance = CVAR_INIT ("autobalance", "Off", CV_SAVE|CV_NETVAR|CV_CALL, CV_OnOff, AutoBalance_OnChange);
|
||||
consvar_t cv_teamscramble = CVAR_INIT ("teamscramble", "Off", CV_SAVE|CV_NETVAR|CV_CALL|CV_NOINIT, teamscramble_cons_t, TeamScramble_OnChange);
|
||||
consvar_t cv_scrambleonchange = CVAR_INIT ("scrambleonchange", "Off", CV_SAVE|CV_NETVAR, teamscramble_cons_t, NULL);
|
||||
consvar_t cv_autobalance = CVAR_INIT ("autobalance", "Off", CV_SAVE|CV_NETVAR|CV_CALL|CV_ALLOWLUA, CV_OnOff, AutoBalance_OnChange);
|
||||
consvar_t cv_teamscramble = CVAR_INIT ("teamscramble", "Off", CV_SAVE|CV_NETVAR|CV_CALL|CV_NOINIT|CV_ALLOWLUA, teamscramble_cons_t, TeamScramble_OnChange);
|
||||
consvar_t cv_scrambleonchange = CVAR_INIT ("scrambleonchange", "Off", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, teamscramble_cons_t, NULL);
|
||||
|
||||
consvar_t cv_friendlyfire = CVAR_INIT ("friendlyfire", "Off", CV_SAVE|CV_NETVAR, CV_OnOff, NULL);
|
||||
consvar_t cv_itemfinder = CVAR_INIT ("itemfinder", "Off", CV_CALL, CV_OnOff, ItemFinder_OnChange);
|
||||
consvar_t cv_friendlyfire = CVAR_INIT ("friendlyfire", "Off", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, CV_OnOff, NULL);
|
||||
consvar_t cv_itemfinder = CVAR_INIT ("itemfinder", "Off", CV_CALL|CV_ALLOWLUA, CV_OnOff, ItemFinder_OnChange);
|
||||
|
||||
// Scoring type options
|
||||
consvar_t cv_overtime = CVAR_INIT ("overtime", "Yes", CV_SAVE|CV_NETVAR, CV_YesNo, NULL);
|
||||
consvar_t cv_overtime = CVAR_INIT ("overtime", "Yes", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, CV_YesNo, NULL);
|
||||
|
||||
consvar_t cv_rollingdemos = CVAR_INIT ("rollingdemos", "On", CV_SAVE, CV_OnOff, NULL);
|
||||
|
||||
|
@ -315,13 +315,13 @@ static CV_PossibleValue_t powerupdisplay_cons_t[] = {{0, "Never"}, {1, "First-pe
|
|||
consvar_t cv_powerupdisplay = CVAR_INIT ("powerupdisplay", "First-person only", CV_SAVE, powerupdisplay_cons_t, NULL);
|
||||
|
||||
static CV_PossibleValue_t pointlimit_cons_t[] = {{1, "MIN"}, {MAXSCORE, "MAX"}, {0, "None"}, {0, NULL}};
|
||||
consvar_t cv_pointlimit = CVAR_INIT ("pointlimit", "None", CV_SAVE|CV_NETVAR|CV_CALL|CV_NOINIT, pointlimit_cons_t, PointLimit_OnChange);
|
||||
consvar_t cv_pointlimit = CVAR_INIT ("pointlimit", "None", CV_SAVE|CV_NETVAR|CV_CALL|CV_NOINIT|CV_ALLOWLUA, pointlimit_cons_t, PointLimit_OnChange);
|
||||
static CV_PossibleValue_t timelimit_cons_t[] = {{1, "MIN"}, {30, "MAX"}, {0, "None"}, {0, NULL}};
|
||||
consvar_t cv_timelimit = CVAR_INIT ("timelimit", "None", CV_SAVE|CV_NETVAR|CV_CALL|CV_NOINIT, timelimit_cons_t, TimeLimit_OnChange);
|
||||
consvar_t cv_timelimit = CVAR_INIT ("timelimit", "None", CV_SAVE|CV_NETVAR|CV_CALL|CV_NOINIT|CV_ALLOWLUA, timelimit_cons_t, TimeLimit_OnChange);
|
||||
static CV_PossibleValue_t numlaps_cons_t[] = {{1, "MIN"}, {50, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_numlaps = CVAR_INIT ("numlaps", "4", CV_NETVAR|CV_CALL|CV_NOINIT, numlaps_cons_t, NumLaps_OnChange);
|
||||
consvar_t cv_numlaps = CVAR_INIT ("numlaps", "4", CV_NETVAR|CV_CALL|CV_NOINIT|CV_ALLOWLUA, numlaps_cons_t, NumLaps_OnChange);
|
||||
static CV_PossibleValue_t basenumlaps_cons_t[] = {{1, "MIN"}, {50, "MAX"}, {0, "Map default"}, {0, NULL}};
|
||||
consvar_t cv_basenumlaps = CVAR_INIT ("basenumlaps", "Map default", CV_SAVE|CV_NETVAR|CV_CALL|CV_CHEAT, basenumlaps_cons_t, BaseNumLaps_OnChange);
|
||||
consvar_t cv_basenumlaps = CVAR_INIT ("basenumlaps", "Map default", CV_SAVE|CV_NETVAR|CV_CALL|CV_CHEAT|CV_ALLOWLUA, basenumlaps_cons_t, BaseNumLaps_OnChange);
|
||||
|
||||
// Point and time limits for every gametype
|
||||
INT32 pointlimits[NUMGAMETYPES];
|
||||
|
@ -330,11 +330,11 @@ INT32 timelimits[NUMGAMETYPES];
|
|||
// log elemental hazards -- not a netvar, is local to current player
|
||||
consvar_t cv_hazardlog = CVAR_INIT ("hazardlog", "Yes", 0, CV_YesNo, NULL);
|
||||
|
||||
consvar_t cv_forceskin = CVAR_INIT ("forceskin", "None", CV_NETVAR|CV_CALL|CV_CHEAT, NULL, ForceSkin_OnChange);
|
||||
consvar_t cv_forceskin = CVAR_INIT ("forceskin", "None", CV_NETVAR|CV_CALL|CV_CHEAT|CV_ALLOWLUA, NULL, ForceSkin_OnChange);
|
||||
consvar_t cv_downloading = CVAR_INIT ("downloading", "On", 0, CV_OnOff, NULL);
|
||||
consvar_t cv_allowexitlevel = CVAR_INIT ("allowexitlevel", "No", CV_SAVE|CV_NETVAR, CV_YesNo, NULL);
|
||||
consvar_t cv_allowexitlevel = CVAR_INIT ("allowexitlevel", "No", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, CV_YesNo, NULL);
|
||||
|
||||
consvar_t cv_killingdead = CVAR_INIT ("killingdead", "Off", CV_NETVAR, CV_OnOff, NULL);
|
||||
consvar_t cv_killingdead = CVAR_INIT ("killingdead", "Off", CV_NETVAR|CV_ALLOWLUA, CV_OnOff, NULL);
|
||||
|
||||
consvar_t cv_netstat = CVAR_INIT ("netstat", "Off", 0, CV_OnOff, NULL); // show bandwidth statistics
|
||||
static CV_PossibleValue_t nettimeout_cons_t[] = {{TICRATE/7, "MIN"}, {60*TICRATE, "MAX"}, {0, NULL}};
|
||||
|
@ -352,26 +352,26 @@ consvar_t cv_showping = CVAR_INIT ("showping", "Warning", CV_SAVE, showping_cons
|
|||
|
||||
// Intermission time Tails 04-19-2002
|
||||
static CV_PossibleValue_t inttime_cons_t[] = {{0, "MIN"}, {3600, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_inttime = CVAR_INIT ("inttime", "10", CV_SAVE|CV_NETVAR, inttime_cons_t, NULL);
|
||||
consvar_t cv_inttime = CVAR_INIT ("inttime", "10", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, inttime_cons_t, NULL);
|
||||
|
||||
static CV_PossibleValue_t coopstarposts_cons_t[] = {{0, "Per-player"}, {1, "Shared"}, {2, "Teamwork"}, {0, NULL}};
|
||||
consvar_t cv_coopstarposts = CVAR_INIT ("coopstarposts", "Per-player", CV_SAVE|CV_NETVAR|CV_CALL, coopstarposts_cons_t, CoopStarposts_OnChange);
|
||||
consvar_t cv_coopstarposts = CVAR_INIT ("coopstarposts", "Per-player", CV_SAVE|CV_NETVAR|CV_CALL|CV_ALLOWLUA, coopstarposts_cons_t, CoopStarposts_OnChange);
|
||||
|
||||
static CV_PossibleValue_t cooplives_cons_t[] = {{0, "Infinite"}, {1, "Per-player"}, {2, "Avoid Game Over"}, {3, "Single pool"}, {0, NULL}};
|
||||
consvar_t cv_cooplives = CVAR_INIT ("cooplives", "Avoid Game Over", CV_SAVE|CV_NETVAR|CV_CALL|CV_CHEAT, cooplives_cons_t, CoopLives_OnChange);
|
||||
consvar_t cv_cooplives = CVAR_INIT ("cooplives", "Avoid Game Over", CV_SAVE|CV_NETVAR|CV_CALL|CV_CHEAT|CV_ALLOWLUA, cooplives_cons_t, CoopLives_OnChange);
|
||||
|
||||
static CV_PossibleValue_t advancemap_cons_t[] = {{0, "Off"}, {1, "Next"}, {2, "Random"}, {0, NULL}};
|
||||
consvar_t cv_advancemap = CVAR_INIT ("advancemap", "Next", CV_SAVE|CV_NETVAR, advancemap_cons_t, NULL);
|
||||
consvar_t cv_advancemap = CVAR_INIT ("advancemap", "Next", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, advancemap_cons_t, NULL);
|
||||
|
||||
static CV_PossibleValue_t playersforexit_cons_t[] = {{0, "One"}, {1, "1/4"}, {2, "Half"}, {3, "3/4"}, {4, "All"}, {0, NULL}};
|
||||
consvar_t cv_playersforexit = CVAR_INIT ("playersforexit", "All", CV_SAVE|CV_NETVAR, playersforexit_cons_t, NULL);
|
||||
consvar_t cv_playersforexit = CVAR_INIT ("playersforexit", "All", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, playersforexit_cons_t, NULL);
|
||||
|
||||
consvar_t cv_exitmove = CVAR_INIT ("exitmove", "On", CV_SAVE|CV_NETVAR|CV_CALL, CV_OnOff, ExitMove_OnChange);
|
||||
consvar_t cv_exitmove = CVAR_INIT ("exitmove", "On", CV_SAVE|CV_NETVAR|CV_CALL|CV_ALLOWLUA, CV_OnOff, ExitMove_OnChange);
|
||||
|
||||
consvar_t cv_runscripts = CVAR_INIT ("runscripts", "Yes", 0, CV_YesNo, NULL);
|
||||
consvar_t cv_runscripts = CVAR_INIT ("runscripts", "Yes", CV_ALLOWLUA, CV_YesNo, NULL);
|
||||
|
||||
consvar_t cv_pause = CVAR_INIT ("pausepermission", "Server", CV_SAVE|CV_NETVAR, pause_cons_t, NULL);
|
||||
consvar_t cv_mute = CVAR_INIT ("mute", "Off", CV_NETVAR|CV_CALL, CV_OnOff, Mute_OnChange);
|
||||
consvar_t cv_pause = CVAR_INIT ("pausepermission", "Server", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, pause_cons_t, NULL);
|
||||
consvar_t cv_mute = CVAR_INIT ("mute", "Off", CV_NETVAR|CV_CALL|CV_ALLOWLUA, CV_OnOff, Mute_OnChange);
|
||||
|
||||
consvar_t cv_sleep = CVAR_INIT ("cpusleep", "1", CV_SAVE, sleeping_cons_t, NULL);
|
||||
|
||||
|
@ -464,57 +464,57 @@ void D_RegisterServerCommands(void)
|
|||
RegisterNetXCmd(XD_LUAFILE, Got_LuaFile);
|
||||
|
||||
// Remote Administration
|
||||
COM_AddCommand("password", Command_Changepassword_f);
|
||||
COM_AddCommand("login", Command_Login_f); // useful in dedicated to kick off remote admin
|
||||
COM_AddCommand("promote", Command_Verify_f);
|
||||
COM_AddCommand("password", Command_Changepassword_f, COM_LUA);
|
||||
COM_AddCommand("login", Command_Login_f, COM_LUA); // useful in dedicated to kick off remote admin
|
||||
COM_AddCommand("promote", Command_Verify_f, COM_LUA);
|
||||
RegisterNetXCmd(XD_VERIFIED, Got_Verification);
|
||||
COM_AddCommand("demote", Command_RemoveAdmin_f);
|
||||
COM_AddCommand("demote", Command_RemoveAdmin_f, COM_LUA);
|
||||
RegisterNetXCmd(XD_DEMOTED, Got_Removal);
|
||||
|
||||
COM_AddCommand("motd", Command_MotD_f);
|
||||
COM_AddCommand("motd", Command_MotD_f, COM_LUA);
|
||||
RegisterNetXCmd(XD_SETMOTD, Got_MotD_f); // For remote admin
|
||||
|
||||
RegisterNetXCmd(XD_TEAMCHANGE, Got_Teamchange);
|
||||
COM_AddCommand("serverchangeteam", Command_ServerTeamChange_f);
|
||||
COM_AddCommand("serverchangeteam", Command_ServerTeamChange_f, COM_LUA);
|
||||
|
||||
RegisterNetXCmd(XD_CLEARSCORES, Got_Clearscores);
|
||||
COM_AddCommand("clearscores", Command_Clearscores_f);
|
||||
COM_AddCommand("map", Command_Map_f);
|
||||
COM_AddCommand("clearscores", Command_Clearscores_f, COM_LUA);
|
||||
COM_AddCommand("map", Command_Map_f, COM_LUA);
|
||||
|
||||
COM_AddCommand("exitgame", Command_ExitGame_f);
|
||||
COM_AddCommand("retry", Command_Retry_f);
|
||||
COM_AddCommand("exitlevel", Command_ExitLevel_f);
|
||||
COM_AddCommand("showmap", Command_Showmap_f);
|
||||
COM_AddCommand("mapmd5", Command_Mapmd5_f);
|
||||
COM_AddCommand("exitgame", Command_ExitGame_f, COM_LUA);
|
||||
COM_AddCommand("retry", Command_Retry_f, COM_LUA);
|
||||
COM_AddCommand("exitlevel", Command_ExitLevel_f, COM_LUA);
|
||||
COM_AddCommand("showmap", Command_Showmap_f, COM_LUA);
|
||||
COM_AddCommand("mapmd5", Command_Mapmd5_f, COM_LUA);
|
||||
|
||||
COM_AddCommand("addfolder", Command_Addfolder);
|
||||
COM_AddCommand("addfile", Command_Addfile);
|
||||
COM_AddCommand("listwad", Command_ListWADS_f);
|
||||
COM_AddCommand("addfolder", Command_Addfolder, COM_LUA);
|
||||
COM_AddCommand("addfile", Command_Addfile, COM_LUA);
|
||||
COM_AddCommand("listwad", Command_ListWADS_f, COM_LUA);
|
||||
|
||||
COM_AddCommand("runsoc", Command_RunSOC);
|
||||
COM_AddCommand("pause", Command_Pause);
|
||||
COM_AddCommand("suicide", Command_Suicide);
|
||||
COM_AddCommand("runsoc", Command_RunSOC, COM_LUA);
|
||||
COM_AddCommand("pause", Command_Pause, COM_LUA);
|
||||
COM_AddCommand("suicide", Command_Suicide, COM_LUA);
|
||||
|
||||
COM_AddCommand("gametype", Command_ShowGametype_f);
|
||||
COM_AddCommand("version", Command_Version_f);
|
||||
COM_AddCommand("gametype", Command_ShowGametype_f, COM_LUA);
|
||||
COM_AddCommand("version", Command_Version_f, COM_LUA);
|
||||
#ifdef UPDATE_ALERT
|
||||
COM_AddCommand("mod_details", Command_ModDetails_f);
|
||||
COM_AddCommand("mod_details", Command_ModDetails_f, COM_LUA);
|
||||
#endif
|
||||
COM_AddCommand("quit", Command_Quit_f);
|
||||
COM_AddCommand("quit", Command_Quit_f, COM_LUA);
|
||||
|
||||
COM_AddCommand("saveconfig", Command_SaveConfig_f);
|
||||
COM_AddCommand("loadconfig", Command_LoadConfig_f);
|
||||
COM_AddCommand("changeconfig", Command_ChangeConfig_f);
|
||||
COM_AddCommand("isgamemodified", Command_Isgamemodified_f); // test
|
||||
COM_AddCommand("showscores", Command_ShowScores_f);
|
||||
COM_AddCommand("showtime", Command_ShowTime_f);
|
||||
COM_AddCommand("cheats", Command_Cheats_f); // test
|
||||
COM_AddCommand("saveconfig", Command_SaveConfig_f, 0);
|
||||
COM_AddCommand("loadconfig", Command_LoadConfig_f, 0);
|
||||
COM_AddCommand("changeconfig", Command_ChangeConfig_f, 0);
|
||||
COM_AddCommand("isgamemodified", Command_Isgamemodified_f, COM_LUA); // test
|
||||
COM_AddCommand("showscores", Command_ShowScores_f, COM_LUA);
|
||||
COM_AddCommand("showtime", Command_ShowTime_f, COM_LUA);
|
||||
COM_AddCommand("cheats", Command_Cheats_f, COM_LUA); // test
|
||||
#ifdef _DEBUG
|
||||
COM_AddCommand("togglemodified", Command_Togglemodified_f);
|
||||
COM_AddCommand("archivetest", Command_Archivetest_f);
|
||||
COM_AddCommand("togglemodified", Command_Togglemodified_f, COM_LUA);
|
||||
COM_AddCommand("archivetest", Command_Archivetest_f, COM_LUA);
|
||||
#endif
|
||||
|
||||
COM_AddCommand("downloads", Command_Downloads_f);
|
||||
COM_AddCommand("downloads", Command_Downloads_f, COM_LUA);
|
||||
|
||||
// for master server connection
|
||||
AddMServCommands();
|
||||
|
@ -601,7 +601,7 @@ void D_RegisterServerCommands(void)
|
|||
CV_RegisterVar(&cv_blamecfail);
|
||||
#endif
|
||||
|
||||
COM_AddCommand("ping", Command_Ping_f);
|
||||
COM_AddCommand("ping", Command_Ping_f, COM_LUA);
|
||||
CV_RegisterVar(&cv_nettimeout);
|
||||
CV_RegisterVar(&cv_jointimeout);
|
||||
|
||||
|
@ -613,6 +613,10 @@ void D_RegisterServerCommands(void)
|
|||
|
||||
CV_RegisterVar(&cv_allowseenames);
|
||||
|
||||
// Other filesrch.c consvars are defined in D_RegisterClientCommands
|
||||
CV_RegisterVar(&cv_addons_option);
|
||||
CV_RegisterVar(&cv_addons_folder);
|
||||
|
||||
CV_RegisterVar(&cv_dummyconsvar);
|
||||
}
|
||||
|
||||
|
@ -645,25 +649,25 @@ void D_RegisterClientCommands(void)
|
|||
if (dedicated)
|
||||
return;
|
||||
|
||||
COM_AddCommand("numthinkers", Command_Numthinkers_f);
|
||||
COM_AddCommand("countmobjs", Command_CountMobjs_f);
|
||||
COM_AddCommand("numthinkers", Command_Numthinkers_f, COM_LUA);
|
||||
COM_AddCommand("countmobjs", Command_CountMobjs_f, COM_LUA);
|
||||
|
||||
COM_AddCommand("changeteam", Command_Teamchange_f);
|
||||
COM_AddCommand("changeteam2", Command_Teamchange2_f);
|
||||
COM_AddCommand("changeteam", Command_Teamchange_f, COM_LUA);
|
||||
COM_AddCommand("changeteam2", Command_Teamchange2_f, COM_LUA);
|
||||
|
||||
COM_AddCommand("playdemo", Command_Playdemo_f);
|
||||
COM_AddCommand("timedemo", Command_Timedemo_f);
|
||||
COM_AddCommand("stopdemo", Command_Stopdemo_f);
|
||||
COM_AddCommand("playintro", Command_Playintro_f);
|
||||
COM_AddCommand("playdemo", Command_Playdemo_f, 0);
|
||||
COM_AddCommand("timedemo", Command_Timedemo_f, 0);
|
||||
COM_AddCommand("stopdemo", Command_Stopdemo_f, COM_LUA);
|
||||
COM_AddCommand("playintro", Command_Playintro_f, COM_LUA);
|
||||
|
||||
COM_AddCommand("resetcamera", Command_ResetCamera_f);
|
||||
COM_AddCommand("resetcamera", Command_ResetCamera_f, COM_LUA);
|
||||
|
||||
COM_AddCommand("setcontrol", Command_Setcontrol_f);
|
||||
COM_AddCommand("setcontrol2", Command_Setcontrol2_f);
|
||||
COM_AddCommand("setcontrol", Command_Setcontrol_f, 0);
|
||||
COM_AddCommand("setcontrol2", Command_Setcontrol2_f, 0);
|
||||
|
||||
COM_AddCommand("screenshot", M_ScreenShot);
|
||||
COM_AddCommand("startmovie", Command_StartMovie_f);
|
||||
COM_AddCommand("stopmovie", Command_StopMovie_f);
|
||||
COM_AddCommand("screenshot", M_ScreenShot, COM_LUA);
|
||||
COM_AddCommand("startmovie", Command_StartMovie_f, COM_LUA);
|
||||
COM_AddCommand("stopmovie", Command_StopMovie_f, COM_LUA);
|
||||
|
||||
CV_RegisterVar(&cv_screenshot_option);
|
||||
CV_RegisterVar(&cv_screenshot_folder);
|
||||
|
@ -725,7 +729,7 @@ void D_RegisterClientCommands(void)
|
|||
CV_RegisterVar(&cv_ghost_last);
|
||||
CV_RegisterVar(&cv_ghost_guest);
|
||||
|
||||
COM_AddCommand("displayplayer", Command_Displayplayer_f);
|
||||
COM_AddCommand("displayplayer", Command_Displayplayer_f, COM_LUA);
|
||||
|
||||
// FIXME: not to be here.. but needs be done for config loading
|
||||
CV_RegisterVar(&cv_globalgamma);
|
||||
|
@ -794,8 +798,8 @@ void D_RegisterClientCommands(void)
|
|||
CV_RegisterVar(&cv_digitaldeadzone2);
|
||||
|
||||
// filesrch.c
|
||||
CV_RegisterVar(&cv_addons_option);
|
||||
CV_RegisterVar(&cv_addons_folder);
|
||||
//CV_RegisterVar(&cv_addons_option); // These two are now defined
|
||||
//CV_RegisterVar(&cv_addons_folder); // in D_RegisterServerCommands
|
||||
CV_RegisterVar(&cv_addons_md5);
|
||||
CV_RegisterVar(&cv_addons_showall);
|
||||
CV_RegisterVar(&cv_addons_search_type);
|
||||
|
@ -882,7 +886,7 @@ void D_RegisterClientCommands(void)
|
|||
CV_RegisterVar(&cv_ps_descriptor);
|
||||
|
||||
// ingame object placing
|
||||
COM_AddCommand("objectplace", Command_ObjectPlace_f);
|
||||
COM_AddCommand("objectplace", Command_ObjectPlace_f, COM_LUA);
|
||||
//COM_AddCommand("writethings", Command_Writethings_f);
|
||||
CV_RegisterVar(&cv_speed);
|
||||
CV_RegisterVar(&cv_opflags);
|
||||
|
@ -894,32 +898,32 @@ void D_RegisterClientCommands(void)
|
|||
CV_RegisterVar(&cv_freedemocamera);
|
||||
|
||||
// add cheat commands
|
||||
COM_AddCommand("noclip", Command_CheatNoClip_f);
|
||||
COM_AddCommand("god", Command_CheatGod_f);
|
||||
COM_AddCommand("notarget", Command_CheatNoTarget_f);
|
||||
COM_AddCommand("getallemeralds", Command_Getallemeralds_f);
|
||||
COM_AddCommand("resetemeralds", Command_Resetemeralds_f);
|
||||
COM_AddCommand("setrings", Command_Setrings_f);
|
||||
COM_AddCommand("setlives", Command_Setlives_f);
|
||||
COM_AddCommand("setcontinues", Command_Setcontinues_f);
|
||||
COM_AddCommand("devmode", Command_Devmode_f);
|
||||
COM_AddCommand("savecheckpoint", Command_Savecheckpoint_f);
|
||||
COM_AddCommand("scale", Command_Scale_f);
|
||||
COM_AddCommand("gravflip", Command_Gravflip_f);
|
||||
COM_AddCommand("hurtme", Command_Hurtme_f);
|
||||
COM_AddCommand("jumptoaxis", Command_JumpToAxis_f);
|
||||
COM_AddCommand("charability", Command_Charability_f);
|
||||
COM_AddCommand("charspeed", Command_Charspeed_f);
|
||||
COM_AddCommand("teleport", Command_Teleport_f);
|
||||
COM_AddCommand("rteleport", Command_RTeleport_f);
|
||||
COM_AddCommand("skynum", Command_Skynum_f);
|
||||
COM_AddCommand("weather", Command_Weather_f);
|
||||
COM_AddCommand("toggletwod", Command_Toggletwod_f);
|
||||
COM_AddCommand("noclip", Command_CheatNoClip_f, COM_LUA);
|
||||
COM_AddCommand("god", Command_CheatGod_f, COM_LUA);
|
||||
COM_AddCommand("notarget", Command_CheatNoTarget_f, COM_LUA);
|
||||
COM_AddCommand("getallemeralds", Command_Getallemeralds_f, COM_LUA);
|
||||
COM_AddCommand("resetemeralds", Command_Resetemeralds_f, COM_LUA);
|
||||
COM_AddCommand("setrings", Command_Setrings_f, COM_LUA);
|
||||
COM_AddCommand("setlives", Command_Setlives_f, COM_LUA);
|
||||
COM_AddCommand("setcontinues", Command_Setcontinues_f, COM_LUA);
|
||||
COM_AddCommand("devmode", Command_Devmode_f, COM_LUA);
|
||||
COM_AddCommand("savecheckpoint", Command_Savecheckpoint_f, COM_LUA);
|
||||
COM_AddCommand("scale", Command_Scale_f, COM_LUA);
|
||||
COM_AddCommand("gravflip", Command_Gravflip_f, COM_LUA);
|
||||
COM_AddCommand("hurtme", Command_Hurtme_f, COM_LUA);
|
||||
COM_AddCommand("jumptoaxis", Command_JumpToAxis_f, COM_LUA);
|
||||
COM_AddCommand("charability", Command_Charability_f, COM_LUA);
|
||||
COM_AddCommand("charspeed", Command_Charspeed_f, COM_LUA);
|
||||
COM_AddCommand("teleport", Command_Teleport_f, COM_LUA);
|
||||
COM_AddCommand("rteleport", Command_RTeleport_f, COM_LUA);
|
||||
COM_AddCommand("skynum", Command_Skynum_f, COM_LUA);
|
||||
COM_AddCommand("weather", Command_Weather_f, COM_LUA);
|
||||
COM_AddCommand("toggletwod", Command_Toggletwod_f, COM_LUA);
|
||||
#ifdef _DEBUG
|
||||
COM_AddCommand("causecfail", Command_CauseCfail_f);
|
||||
COM_AddCommand("causecfail", Command_CauseCfail_f, COM_LUA);
|
||||
#endif
|
||||
#ifdef LUA_ALLOW_BYTECODE
|
||||
COM_AddCommand("dumplua", Command_Dumplua_f);
|
||||
COM_AddCommand("dumplua", Command_Dumplua_f, COM_LUA);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1879,7 +1883,7 @@ static void Command_Map_f(void)
|
|||
const char *gametypename;
|
||||
boolean newresetplayers;
|
||||
|
||||
boolean mustmodifygame;
|
||||
boolean wouldSetCheats;
|
||||
|
||||
INT32 newmapnum;
|
||||
|
||||
|
@ -1900,11 +1904,11 @@ static void Command_Map_f(void)
|
|||
option_gametype = COM_CheckPartialParm("-g");
|
||||
newresetplayers = ! COM_CheckParm("-noresetplayers");
|
||||
|
||||
mustmodifygame =
|
||||
!( netgame || multiplayer ) &&
|
||||
(!modifiedgame || savemoddata );
|
||||
wouldSetCheats =
|
||||
!( netgame || multiplayer ) &&
|
||||
!( usedCheats );
|
||||
|
||||
if (mustmodifygame && !option_force)
|
||||
if (wouldSetCheats && !option_force)
|
||||
{
|
||||
/* May want to be more descriptive? */
|
||||
CONS_Printf(M_GetText("Sorry, level change disabled in single player.\n"));
|
||||
|
@ -1958,9 +1962,9 @@ static void Command_Map_f(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (mustmodifygame && option_force)
|
||||
if (wouldSetCheats && option_force)
|
||||
{
|
||||
G_SetGameModified(false);
|
||||
G_SetUsedCheats(false);
|
||||
}
|
||||
|
||||
// new gametype value
|
||||
|
@ -4310,7 +4314,7 @@ static void Ringslinger_OnChange(void)
|
|||
}
|
||||
|
||||
if (cv_ringslinger.value) // Only if it's been turned on
|
||||
G_SetGameModified(multiplayer);
|
||||
G_SetUsedCheats(false);
|
||||
}
|
||||
|
||||
static void Gravity_OnChange(void)
|
||||
|
@ -4331,7 +4335,7 @@ static void Gravity_OnChange(void)
|
|||
#endif
|
||||
|
||||
if (!CV_IsSetToDefault(&cv_gravity))
|
||||
G_SetGameModified(multiplayer);
|
||||
G_SetUsedCheats(false);
|
||||
gravity = cv_gravity.value;
|
||||
}
|
||||
|
||||
|
@ -4647,7 +4651,7 @@ static void Fishcake_OnChange(void)
|
|||
// so don't make modifiedgame always on!
|
||||
if (cv_debug)
|
||||
{
|
||||
G_SetGameModified(multiplayer);
|
||||
G_SetUsedCheats(false);
|
||||
}
|
||||
|
||||
else if (cv_debug != cv_fishcake.value)
|
||||
|
@ -4664,11 +4668,11 @@ static void Fishcake_OnChange(void)
|
|||
static void Command_Isgamemodified_f(void)
|
||||
{
|
||||
if (savemoddata)
|
||||
CONS_Printf(M_GetText("modifiedgame is true, but you can save emblem and time data in this mod.\n"));
|
||||
CONS_Printf(M_GetText("modifiedgame is true, but you can save time data in this mod.\n"));
|
||||
else if (modifiedgame)
|
||||
CONS_Printf(M_GetText("modifiedgame is true, extras will not be unlocked\n"));
|
||||
CONS_Printf(M_GetText("modifiedgame is true, time data can't be saved\n"));
|
||||
else
|
||||
CONS_Printf(M_GetText("modifiedgame is false, you can unlock extras\n"));
|
||||
CONS_Printf(M_GetText("modifiedgame is false, you can save time data\n"));
|
||||
}
|
||||
|
||||
static void Command_Cheats_f(void)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -188,6 +188,9 @@ static inline int lib_freeslot(lua_State *L)
|
|||
lua_remove(L, 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
R_RefreshSprite2();
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -513,6 +513,8 @@ void readfreeslots(MYFILE *f)
|
|||
} while (!myfeof(f)); // finish when the line is empty
|
||||
|
||||
Z_Free(s);
|
||||
|
||||
R_RefreshSprite2();
|
||||
}
|
||||
|
||||
void readthing(MYFILE *f, INT32 num)
|
||||
|
@ -2907,7 +2909,9 @@ static boolean GoodDataFileName(const char *s)
|
|||
p = s + strlen(s) - strlen(tail);
|
||||
if (p <= s) return false; // too short
|
||||
if (!fasticmp(p, tail)) return false; // doesn't end in .dat
|
||||
if (fasticmp(s, "gamedata.dat")) return false;
|
||||
|
||||
if (fasticmp(s, "gamedata.dat")) return false; // Don't overwrite default gamedata
|
||||
if (fasticmp(s, "main.dat")) return false; // Don't overwrite default time attack replays
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -5525,7 +5525,7 @@ struct int_const_s const INT_CONST[] = {
|
|||
{"CV_HIDEN",CV_HIDEN},
|
||||
{"CV_HIDDEN",CV_HIDEN},
|
||||
{"CV_CHEAT",CV_CHEAT},
|
||||
{"CV_NOLUA",CV_NOLUA},
|
||||
{"CV_ALLOWLUA",CV_ALLOWLUA},
|
||||
|
||||
// v_video flags
|
||||
{"V_NOSCALEPATCH",V_NOSCALEPATCH},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -104,6 +104,8 @@
|
|||
#include <io.h>
|
||||
#endif
|
||||
|
||||
FILE *fopenfile(const char*, const char*);
|
||||
|
||||
//#define NOMD5
|
||||
|
||||
// Uncheck this to compile debugging code
|
||||
|
@ -150,7 +152,7 @@ extern char logfilename[1024];
|
|||
|
||||
// Does this version require an added patch file?
|
||||
// Comment or uncomment this as necessary.
|
||||
// #define USE_PATCH_DTA
|
||||
#define USE_PATCH_DTA
|
||||
|
||||
// Enforce a limit of loaded WAD files.
|
||||
//#define ENFORCE_WAD_LIMIT
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -75,6 +75,7 @@ extern SINT8 startinglivesbalance[maxgameovers+1];
|
|||
extern boolean modifiedgame;
|
||||
extern UINT16 mainwads;
|
||||
extern boolean savemoddata; // This mod saves time/emblem data.
|
||||
extern boolean usedCheats;
|
||||
extern boolean disableSpeedAdjust; // Don't alter the duration of player states if true
|
||||
extern boolean imcontinuing; // Temporary flag while continuing
|
||||
extern boolean metalrecording;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -97,6 +97,9 @@ typedef long ssize_t;
|
|||
char *strcasestr(const char *in, const char *what);
|
||||
#define stristr strcasestr
|
||||
|
||||
int startswith (const char *base, const char *tag);
|
||||
int endswith (const char *base, const char *tag);
|
||||
|
||||
#if defined (macintosh) //|| defined (__APPLE__) //skip all boolean/Boolean crap
|
||||
#define true 1
|
||||
#define false 0
|
||||
|
|
|
@ -8,7 +8,7 @@ UINT8 graphics_started = 0;
|
|||
|
||||
UINT8 keyboard_started = 0;
|
||||
|
||||
UINT32 I_GetFreeMem(UINT32 *total)
|
||||
size_t I_GetFreeMem(size_t *total)
|
||||
{
|
||||
*total = 0;
|
||||
return 0;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2014-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 2014-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -337,7 +337,7 @@ static tic_t introscenetime[NUMINTROSCENES] =
|
|||
};
|
||||
|
||||
// custom intros
|
||||
void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer);
|
||||
void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer, boolean FLS);
|
||||
|
||||
void F_StartIntro(void)
|
||||
{
|
||||
|
@ -349,7 +349,7 @@ void F_StartIntro(void)
|
|||
if (!cutscenes[introtoplay - 1])
|
||||
D_StartTitle();
|
||||
else
|
||||
F_StartCustomCutscene(introtoplay - 1, false, false);
|
||||
F_StartCustomCutscene(introtoplay - 1, false, false, false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1138,7 +1138,7 @@ static const char *credits[] = {
|
|||
"Dave \"DemonTomatoDave\" Bulmer",
|
||||
"Paul \"Boinciel\" Clempson",
|
||||
"\"Cyan Helkaraxe\"",
|
||||
"Shane \"CobaltBW\" Ellis",
|
||||
"Claire \"clairebun\" Ellis",
|
||||
"James \"SeventhSentinel\" Hall",
|
||||
"Kepa \"Nev3r\" Iceta",
|
||||
"Iestyn \"Monster Iestyn\" Jealous",
|
||||
|
@ -1257,7 +1257,7 @@ void F_StartCredits(void)
|
|||
|
||||
if (creditscutscene)
|
||||
{
|
||||
F_StartCustomCutscene(creditscutscene - 1, false, false);
|
||||
F_StartCustomCutscene(creditscutscene - 1, false, false, false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1575,7 +1575,9 @@ void F_GameEvaluationDrawer(void)
|
|||
{
|
||||
V_DrawString(8, 16, V_YELLOWMAP, "Unlocked:");
|
||||
|
||||
if (!(netgame) && (!modifiedgame || savemoddata))
|
||||
if (netgame)
|
||||
V_DrawString(8, 96, V_YELLOWMAP, "Multiplayer games\ncan't unlock\nextras!");
|
||||
else
|
||||
{
|
||||
INT32 startcoord = 32;
|
||||
|
||||
|
@ -1590,10 +1592,6 @@ void F_GameEvaluationDrawer(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (netgame)
|
||||
V_DrawString(8, 96, V_YELLOWMAP, "Multiplayer games\ncan't unlock\nextras!");
|
||||
else
|
||||
V_DrawString(8, 96, V_YELLOWMAP, "Modified games\ncan't unlock\nextras!");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1657,7 +1655,7 @@ void F_GameEvaluationTicker(void)
|
|||
HU_DoCEcho("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Multiplayer games can't unlock extras!");
|
||||
S_StartSound(NULL, sfx_s3k68);
|
||||
}
|
||||
else if (!modifiedgame || savemoddata)
|
||||
else
|
||||
{
|
||||
++timesBeaten;
|
||||
|
||||
|
@ -1672,13 +1670,6 @@ void F_GameEvaluationTicker(void)
|
|||
|
||||
G_SaveGameData();
|
||||
}
|
||||
else
|
||||
{
|
||||
HU_SetCEchoFlags(V_YELLOWMAP|V_RETURN8);
|
||||
HU_SetCEchoDuration(6);
|
||||
HU_DoCEcho("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Modified games can't unlock extras!");
|
||||
S_StartSound(NULL, sfx_s3k68);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2503,6 +2494,8 @@ void F_StartTitleScreen(void)
|
|||
{
|
||||
titlemapinaction = TITLEMAP_OFF;
|
||||
gamemap = 1; // g_game.c
|
||||
if (!mapheaderinfo[gamemap-1])
|
||||
P_AllocMapHeader(gamemap-1);
|
||||
CON_ClearHUD();
|
||||
}
|
||||
|
||||
|
@ -3857,7 +3850,7 @@ static INT32 scenenum, cutnum;
|
|||
static INT32 picxpos, picypos, picnum, pictime, picmode, numpics, pictoloop;
|
||||
static INT32 textxpos, textypos;
|
||||
static boolean cutsceneover = false;
|
||||
static boolean runningprecutscene = false, precutresetplayer = false;
|
||||
static boolean runningprecutscene = false, precutresetplayer = false, precutFLS = false;
|
||||
|
||||
static void F_AdvanceToNextScene(void)
|
||||
{
|
||||
|
@ -3926,7 +3919,7 @@ void F_EndCutScene(void)
|
|||
if (runningprecutscene)
|
||||
{
|
||||
if (server)
|
||||
D_MapChange(gamemap, gametype, ultimatemode, precutresetplayer, 0, true, false);
|
||||
D_MapChange(gamemap, gametype, ultimatemode, precutresetplayer, 0, true, precutFLS);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3941,7 +3934,7 @@ void F_EndCutScene(void)
|
|||
}
|
||||
}
|
||||
|
||||
void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer)
|
||||
void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer, boolean FLS)
|
||||
{
|
||||
if (!cutscenes[cutscenenum])
|
||||
return;
|
||||
|
@ -3960,6 +3953,7 @@ void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean reset
|
|||
cutsceneover = false;
|
||||
runningprecutscene = precutscene;
|
||||
precutresetplayer = resetplayer;
|
||||
precutFLS = FLS;
|
||||
|
||||
scenenum = picnum = 0;
|
||||
cutnum = cutscenenum;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -52,7 +52,7 @@ void F_EndingDrawer(void);
|
|||
void F_CreditTicker(void);
|
||||
void F_CreditDrawer(void);
|
||||
|
||||
void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer);
|
||||
void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer, boolean FLS);
|
||||
void F_CutsceneDrawer(void);
|
||||
void F_EndCutScene(void);
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 2013-2016 by Matthew "Kaito Sinclaire" Walsh.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
#define SUFFIX "*"
|
||||
#define SLASH "\\"
|
||||
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
|
||||
#ifndef INVALID_FILE_ATTRIBUTES
|
||||
|
@ -307,6 +308,39 @@ closedir (DIR * dirp)
|
|||
}
|
||||
#endif
|
||||
|
||||
// fopen but it REALLY only works on regular files
|
||||
// Turns out, on linux, anyway, you can fopen directories
|
||||
// in read mode. (It's supposed to fail in write mode
|
||||
// though!!)
|
||||
FILE *fopenfile(const char *path, const char *mode)
|
||||
{
|
||||
FILE *h = fopen(path, mode);
|
||||
|
||||
if (h != NULL)
|
||||
{
|
||||
struct stat st;
|
||||
int eno;
|
||||
|
||||
if (fstat(fileno(h), &st) == -1)
|
||||
{
|
||||
eno = errno;
|
||||
}
|
||||
else if (!S_ISREG(st.st_mode))
|
||||
{
|
||||
eno = EACCES; // set some kinda error
|
||||
}
|
||||
else
|
||||
{
|
||||
return h; // ok
|
||||
}
|
||||
|
||||
fclose(h);
|
||||
errno = eno;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static CV_PossibleValue_t addons_cons_t[] = {{0, "Default"},
|
||||
#if 1
|
||||
{1, "HOME"}, {2, "SRB2"},
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
168
src/g_game.c
168
src/g_game.c
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -96,6 +96,7 @@ SINT8 startinglivesbalance[maxgameovers+1] = {3, 5, 7, 9, 12, 15, 20, 25, 30, 40
|
|||
UINT16 mainwads = 0;
|
||||
boolean modifiedgame; // Set if homebrew PWAD stuff has been added.
|
||||
boolean savemoddata = false;
|
||||
boolean usedCheats = false; // Set when a gamedata-preventing cheat command is used.
|
||||
UINT8 paused;
|
||||
UINT8 modeattacking = ATTACKING_NONE;
|
||||
boolean disableSpeedAdjust = false;
|
||||
|
@ -364,36 +365,36 @@ consvar_t cv_autobrake2 = CVAR_INIT ("autobrake2", "On", CV_SAVE|CV_CALL, CV_OnO
|
|||
// hi here's some new controls
|
||||
static CV_PossibleValue_t zerotoone_cons_t[] = {{0, "MIN"}, {FRACUNIT, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_cam_shiftfacing[2] = {
|
||||
CVAR_INIT ("cam_shiftfacingchar", "0.375", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL),
|
||||
CVAR_INIT ("cam2_shiftfacingchar", "0.375", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL),
|
||||
CVAR_INIT ("cam_shiftfacingchar", "0.375", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, zerotoone_cons_t, NULL),
|
||||
CVAR_INIT ("cam2_shiftfacingchar", "0.375", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, zerotoone_cons_t, NULL),
|
||||
};
|
||||
consvar_t cv_cam_turnfacing[2] = {
|
||||
CVAR_INIT ("cam_turnfacingchar", "0.25", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL),
|
||||
CVAR_INIT ("cam2_turnfacingchar", "0.25", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL),
|
||||
CVAR_INIT ("cam_turnfacingchar", "0.25", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, zerotoone_cons_t, NULL),
|
||||
CVAR_INIT ("cam2_turnfacingchar", "0.25", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, zerotoone_cons_t, NULL),
|
||||
};
|
||||
consvar_t cv_cam_turnfacingability[2] = {
|
||||
CVAR_INIT ("cam_turnfacingability", "0.125", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL),
|
||||
CVAR_INIT ("cam2_turnfacingability", "0.125", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL),
|
||||
CVAR_INIT ("cam_turnfacingability", "0.125", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, zerotoone_cons_t, NULL),
|
||||
CVAR_INIT ("cam2_turnfacingability", "0.125", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, zerotoone_cons_t, NULL),
|
||||
};
|
||||
consvar_t cv_cam_turnfacingspindash[2] = {
|
||||
CVAR_INIT ("cam_turnfacingspindash", "0.25", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL),
|
||||
CVAR_INIT ("cam2_turnfacingspindash", "0.25", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL),
|
||||
CVAR_INIT ("cam_turnfacingspindash", "0.25", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, zerotoone_cons_t, NULL),
|
||||
CVAR_INIT ("cam2_turnfacingspindash", "0.25", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, zerotoone_cons_t, NULL),
|
||||
};
|
||||
consvar_t cv_cam_turnfacinginput[2] = {
|
||||
CVAR_INIT ("cam_turnfacinginput", "0.375", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL),
|
||||
CVAR_INIT ("cam2_turnfacinginput", "0.375", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL),
|
||||
CVAR_INIT ("cam_turnfacinginput", "0.375", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, zerotoone_cons_t, NULL),
|
||||
CVAR_INIT ("cam2_turnfacinginput", "0.375", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, zerotoone_cons_t, NULL),
|
||||
};
|
||||
|
||||
static CV_PossibleValue_t centertoggle_cons_t[] = {{0, "Hold"}, {1, "Toggle"}, {2, "Sticky Hold"}, {0, NULL}};
|
||||
consvar_t cv_cam_centertoggle[2] = {
|
||||
CVAR_INIT ("cam_centertoggle", "Hold", CV_SAVE, centertoggle_cons_t, NULL),
|
||||
CVAR_INIT ("cam2_centertoggle", "Hold", CV_SAVE, centertoggle_cons_t, NULL),
|
||||
CVAR_INIT ("cam_centertoggle", "Hold", CV_SAVE|CV_ALLOWLUA, centertoggle_cons_t, NULL),
|
||||
CVAR_INIT ("cam2_centertoggle", "Hold", CV_SAVE|CV_ALLOWLUA, centertoggle_cons_t, NULL),
|
||||
};
|
||||
|
||||
static CV_PossibleValue_t lockedinput_cons_t[] = {{0, "Strafe"}, {1, "Turn"}, {0, NULL}};
|
||||
consvar_t cv_cam_lockedinput[2] = {
|
||||
CVAR_INIT ("cam_lockedinput", "Strafe", CV_SAVE, lockedinput_cons_t, NULL),
|
||||
CVAR_INIT ("cam2_lockedinput", "Strafe", CV_SAVE, lockedinput_cons_t, NULL),
|
||||
CVAR_INIT ("cam_lockedinput", "Strafe", CV_SAVE|CV_ALLOWLUA, lockedinput_cons_t, NULL),
|
||||
CVAR_INIT ("cam2_lockedinput", "Strafe", CV_SAVE|CV_ALLOWLUA, lockedinput_cons_t, NULL),
|
||||
};
|
||||
|
||||
static CV_PossibleValue_t lockedassist_cons_t[] = {
|
||||
|
@ -405,14 +406,14 @@ static CV_PossibleValue_t lockedassist_cons_t[] = {
|
|||
{0, NULL}
|
||||
};
|
||||
consvar_t cv_cam_lockonboss[2] = {
|
||||
CVAR_INIT ("cam_lockaimassist", "Full", CV_SAVE, lockedassist_cons_t, NULL),
|
||||
CVAR_INIT ("cam2_lockaimassist", "Full", CV_SAVE, lockedassist_cons_t, NULL),
|
||||
CVAR_INIT ("cam_lockaimassist", "Full", CV_SAVE|CV_ALLOWLUA, lockedassist_cons_t, NULL),
|
||||
CVAR_INIT ("cam2_lockaimassist", "Full", CV_SAVE|CV_ALLOWLUA, lockedassist_cons_t, NULL),
|
||||
};
|
||||
|
||||
consvar_t cv_moveaxis = CVAR_INIT ("joyaxis_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_sideaxis = CVAR_INIT ("joyaxis_side", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_lookaxis = CVAR_INIT ("joyaxis_look", "Y-Rudder-", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_turnaxis = CVAR_INIT ("joyaxis_turn", "X-Rudder", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_lookaxis = CVAR_INIT ("joyaxis_look", "X-Rudder-", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_turnaxis = CVAR_INIT ("joyaxis_turn", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_jumpaxis = CVAR_INIT ("joyaxis_jump", "None", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_spinaxis = CVAR_INIT ("joyaxis_spin", "None", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_fireaxis = CVAR_INIT ("joyaxis_fire", "Z-Rudder", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
|
@ -422,8 +423,8 @@ consvar_t cv_digitaldeadzone = CVAR_INIT ("joy_digdeadzone", "0.25", CV_FLOAT|CV
|
|||
|
||||
consvar_t cv_moveaxis2 = CVAR_INIT ("joyaxis2_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_sideaxis2 = CVAR_INIT ("joyaxis2_side", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_lookaxis2 = CVAR_INIT ("joyaxis2_look", "Y-Rudder-", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_turnaxis2 = CVAR_INIT ("joyaxis2_turn", "X-Rudder", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_lookaxis2 = CVAR_INIT ("joyaxis2_look", "X-Rudder-", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_turnaxis2 = CVAR_INIT ("joyaxis2_turn", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_jumpaxis2 = CVAR_INIT ("joyaxis2_jump", "None", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_spinaxis2 = CVAR_INIT ("joyaxis2_spin", "None", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
consvar_t cv_fireaxis2 = CVAR_INIT ("joyaxis2_fire", "Z-Rudder", CV_SAVE, joyaxis_cons_t, NULL);
|
||||
|
@ -755,7 +756,24 @@ void G_SetGameModified(boolean silent)
|
|||
savemoddata = false;
|
||||
|
||||
if (!silent)
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("Game must be restarted to record statistics.\n"));
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("Game must be restarted to play Record Attack.\n"));
|
||||
|
||||
// If in record attack recording, cancel it.
|
||||
if (modeattacking)
|
||||
M_EndModeAttackRun();
|
||||
else if (marathonmode)
|
||||
Command_ExitGame_f();
|
||||
}
|
||||
|
||||
void G_SetUsedCheats(boolean silent)
|
||||
{
|
||||
if (usedCheats)
|
||||
return;
|
||||
|
||||
usedCheats = true;
|
||||
|
||||
if (!silent)
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("Game must be restarted to save progress.\n"));
|
||||
|
||||
// If in record attack recording, cancel it.
|
||||
if (modeattacking)
|
||||
|
@ -2825,6 +2843,9 @@ void G_MovePlayerToSpawnOrStarpost(INT32 playernum)
|
|||
|
||||
R_ResetMobjInterpolationState(players[playernum].mo);
|
||||
|
||||
if (players[playernum].bot) // don't reset the camera for bots
|
||||
return;
|
||||
|
||||
if (playernum == consoleplayer)
|
||||
P_ResetCamera(&players[playernum], &camera);
|
||||
else if (playernum == secondarydisplayplayer)
|
||||
|
@ -3839,8 +3860,7 @@ static void G_UpdateVisited(void)
|
|||
{
|
||||
boolean spec = G_IsSpecialStage(gamemap);
|
||||
// Update visitation flags?
|
||||
if ((!modifiedgame || savemoddata) // Not modified
|
||||
&& !multiplayer && !demoplayback && (gametype == GT_COOP) // SP/RA/NiGHTS mode
|
||||
if (!multiplayer && !demoplayback && (gametype == GT_COOP) // SP/RA/NiGHTS mode
|
||||
&& !stagefailed) // Did not fail the stage
|
||||
{
|
||||
UINT8 earnedEmblems;
|
||||
|
@ -3908,14 +3928,18 @@ static void G_HandleSaveLevel(void)
|
|||
remove(liveeventbackup);
|
||||
cursaveslot = 0;
|
||||
}
|
||||
else if ((!modifiedgame || savemoddata) && !(netgame || multiplayer || ultimatemode || demorecording || metalrecording || modeattacking))
|
||||
else if (!usedCheats && !(netgame || multiplayer || ultimatemode || demorecording || metalrecording || modeattacking))
|
||||
{
|
||||
G_SaveGame((UINT32)cursaveslot, spstage_start);
|
||||
}
|
||||
}
|
||||
}
|
||||
// and doing THIS here means you don't lose your progress if you close the game mid-intermission
|
||||
else if (!(ultimatemode || netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking)
|
||||
&& (!modifiedgame || savemoddata) && cursaveslot > 0 && CanSaveLevel(lastmap+1))
|
||||
&& !usedCheats && cursaveslot > 0 && CanSaveLevel(lastmap+1))
|
||||
{
|
||||
G_SaveGame((UINT32)cursaveslot, lastmap+1); // not nextmap+1 to route around special stages
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -4105,7 +4129,7 @@ void G_AfterIntermission(void)
|
|||
&& stagefailed == false)
|
||||
{
|
||||
// Start a custom cutscene.
|
||||
F_StartCustomCutscene(mapheaderinfo[gamemap-1]->cutscenenum-1, false, false);
|
||||
F_StartCustomCutscene(mapheaderinfo[gamemap-1]->cutscenenum-1, false, false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -4191,8 +4215,10 @@ static void G_DoContinued(void)
|
|||
tokenlist = 0;
|
||||
token = 0;
|
||||
|
||||
if (!(netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking) && (!modifiedgame || savemoddata) && cursaveslot > 0)
|
||||
if (!(netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking) && !usedCheats && cursaveslot > 0)
|
||||
{
|
||||
G_SaveGameOver((UINT32)cursaveslot, true);
|
||||
}
|
||||
|
||||
// Reset # of lives
|
||||
pl->lives = (ultimatemode) ? 1 : startinglivesbalance[numgameovers];
|
||||
|
@ -4257,13 +4283,17 @@ void G_LoadGameSettings(void)
|
|||
S_InitRuntimeSounds();
|
||||
}
|
||||
|
||||
#define GAMEDATA_ID 0x86E4A27C // Change every major version, as usual
|
||||
#define COMPAT_GAMEDATA_ID 0xFCAFE211 // Can be removed entirely for 2.3
|
||||
|
||||
// G_LoadGameData
|
||||
// Loads the main data file, which stores information such as emblems found, etc.
|
||||
void G_LoadGameData(void)
|
||||
{
|
||||
size_t length;
|
||||
INT32 i, j;
|
||||
UINT8 modded = false;
|
||||
|
||||
UINT32 versionID;
|
||||
UINT8 rtemp;
|
||||
|
||||
//For records
|
||||
|
@ -4274,6 +4304,9 @@ void G_LoadGameData(void)
|
|||
UINT8 recmares;
|
||||
INT32 curmare;
|
||||
|
||||
// Stop saving, until we successfully load it again.
|
||||
gamedataloaded = false;
|
||||
|
||||
// Clear things so previously read gamedata doesn't transfer
|
||||
// to new gamedata
|
||||
G_ClearRecords(); // main and nights records
|
||||
|
@ -4281,27 +4314,35 @@ void G_LoadGameData(void)
|
|||
totalplaytime = 0; // total play time (separate from all)
|
||||
|
||||
if (M_CheckParm("-nodata"))
|
||||
return; // Don't load.
|
||||
|
||||
// Allow saving of gamedata beyond this point
|
||||
gamedataloaded = true;
|
||||
|
||||
if (M_CheckParm("-gamedata") && M_IsNextParm())
|
||||
{
|
||||
strlcpy(gamedatafilename, M_GetNextParm(), sizeof gamedatafilename);
|
||||
// Don't load at all.
|
||||
return;
|
||||
}
|
||||
|
||||
if (M_CheckParm("-resetdata"))
|
||||
return; // Don't load (essentially, reset).
|
||||
{
|
||||
// Don't load, but do save. (essentially, reset)
|
||||
gamedataloaded = true;
|
||||
return;
|
||||
}
|
||||
|
||||
length = FIL_ReadFile(va(pandf, srb2home, gamedatafilename), &savebuffer);
|
||||
if (!length) // Aw, no game data. Their loss!
|
||||
if (!length)
|
||||
{
|
||||
// No gamedata. We can save a new one.
|
||||
gamedataloaded = true;
|
||||
return;
|
||||
}
|
||||
|
||||
save_p = savebuffer;
|
||||
|
||||
// Version check
|
||||
if (READUINT32(save_p) != 0xFCAFE211)
|
||||
versionID = READUINT32(save_p);
|
||||
if (versionID != GAMEDATA_ID
|
||||
#ifdef COMPAT_GAMEDATA_ID // backwards compat behavior
|
||||
&& versionID != COMPAT_GAMEDATA_ID
|
||||
#endif
|
||||
)
|
||||
{
|
||||
const char *gdfolder = "the SRB2 folder";
|
||||
if (strcmp(srb2home,"."))
|
||||
|
@ -4314,13 +4355,35 @@ void G_LoadGameData(void)
|
|||
|
||||
totalplaytime = READUINT32(save_p);
|
||||
|
||||
modded = READUINT8(save_p);
|
||||
#ifdef COMPAT_GAMEDATA_ID
|
||||
if (versionID == COMPAT_GAMEDATA_ID)
|
||||
{
|
||||
// We'll temporarily use the old condition when loading an older file.
|
||||
// The proper mod-specific hash will get saved in afterwards.
|
||||
boolean modded = READUINT8(save_p);
|
||||
|
||||
// Aha! Someone's been screwing with the save file!
|
||||
if ((modded && !savemoddata))
|
||||
goto datacorrupt;
|
||||
else if (modded != true && modded != false)
|
||||
goto datacorrupt;
|
||||
if (modded && !savemoddata)
|
||||
{
|
||||
goto datacorrupt;
|
||||
}
|
||||
else if (modded != true && modded != false)
|
||||
{
|
||||
goto datacorrupt;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
// Quick & dirty hash for what mod this save file is for.
|
||||
UINT32 modID = READUINT32(save_p);
|
||||
UINT32 expectedID = quickncasehash(timeattackfolder, sizeof timeattackfolder);
|
||||
|
||||
if (modID != expectedID)
|
||||
{
|
||||
// Aha! Someone's been screwing with the save file!
|
||||
goto datacorrupt;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO put another cipher on these things? meh, I don't care...
|
||||
for (i = 0; i < NUMMAPS; i++)
|
||||
|
@ -4406,6 +4469,12 @@ void G_LoadGameData(void)
|
|||
Z_Free(savebuffer);
|
||||
save_p = NULL;
|
||||
|
||||
// Don't consider loaded until it's a success!
|
||||
// It used to do this much earlier, but this would cause the gamedata to
|
||||
// save over itself when it I_Errors from the corruption landing point below,
|
||||
// which can accidentally delete players' legitimate data if the code ever has any tiny mistakes!
|
||||
gamedataloaded = true;
|
||||
|
||||
// Silent update unlockables in case they're out of sync with conditions
|
||||
M_SilentUpdateUnlockablesAndEmblems();
|
||||
|
||||
|
@ -4445,7 +4514,7 @@ void G_SaveGameData(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (modifiedgame && !savemoddata)
|
||||
if (usedCheats)
|
||||
{
|
||||
free(savebuffer);
|
||||
save_p = savebuffer = NULL;
|
||||
|
@ -4453,12 +4522,11 @@ void G_SaveGameData(void)
|
|||
}
|
||||
|
||||
// Version test
|
||||
WRITEUINT32(save_p, 0xFCAFE211);
|
||||
WRITEUINT32(save_p, GAMEDATA_ID);
|
||||
|
||||
WRITEUINT32(save_p, totalplaytime);
|
||||
|
||||
btemp = (UINT8)(savemoddata || modifiedgame);
|
||||
WRITEUINT8(save_p, btemp);
|
||||
WRITEUINT32(save_p, quickncasehash(timeattackfolder, sizeof timeattackfolder));
|
||||
|
||||
// TODO put another cipher on these things? meh, I don't care...
|
||||
for (i = 0; i < NUMMAPS; i++)
|
||||
|
@ -4955,7 +5023,7 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean
|
|||
imcontinuing = false;
|
||||
|
||||
if ((gametyperules & GTR_CUTSCENES) && !skipprecutscene && mapheaderinfo[gamemap-1]->precutscenenum && !modeattacking && !(marathonmode & MA_NOCUTSCENES)) // Start a custom cutscene.
|
||||
F_StartCustomCutscene(mapheaderinfo[gamemap-1]->precutscenenum-1, true, resetplayer);
|
||||
F_StartCustomCutscene(mapheaderinfo[gamemap-1]->precutscenenum-1, true, resetplayer, FLS);
|
||||
else
|
||||
G_DoLoadLevel(resetplayer);
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -243,6 +243,7 @@ void G_LoadGameData(void);
|
|||
void G_LoadGameSettings(void);
|
||||
|
||||
void G_SetGameModified(boolean silent);
|
||||
void G_SetUsedCheats(boolean silent);
|
||||
|
||||
void G_SetGamestate(gamestate_t newstate);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -744,31 +744,31 @@ void G_DefineDefaultControls(void)
|
|||
gamecontroldefault[i][GC_CUSTOM1 ][1] = KEY_JOY1+1; // B
|
||||
gamecontroldefault[i][GC_CUSTOM2 ][1] = KEY_JOY1+3; // Y
|
||||
gamecontroldefault[i][GC_CUSTOM3 ][1] = KEY_JOY1+8; // Left Stick
|
||||
gamecontroldefault[i][GC_CENTERVIEW ][1] = KEY_JOY1+9; // Right Stick
|
||||
gamecontroldefault[i][GC_WEAPONPREV ][1] = KEY_JOY1+4; // LB
|
||||
gamecontroldefault[i][GC_WEAPONNEXT ][1] = KEY_JOY1+5; // RB
|
||||
gamecontroldefault[i][GC_CAMTOGGLE ][1] = KEY_JOY1+4; // LB
|
||||
gamecontroldefault[i][GC_CENTERVIEW ][1] = KEY_JOY1+5; // RB
|
||||
gamecontroldefault[i][GC_SCREENSHOT ][1] = KEY_JOY1+6; // Back
|
||||
gamecontroldefault[i][GC_SYSTEMMENU ][0] = KEY_JOY1+7; // Start
|
||||
gamecontroldefault[i][GC_CAMTOGGLE ][1] = KEY_HAT1+0; // D-Pad Up
|
||||
gamecontroldefault[i][GC_VIEWPOINTNEXT][1] = KEY_HAT1+1; // D-Pad Down
|
||||
gamecontroldefault[i][GC_TOSSFLAG ][1] = KEY_HAT1+2; // D-Pad Left
|
||||
gamecontroldefault[i][GC_SCORES ][1] = KEY_HAT1+3; // D-Pad Right
|
||||
gamecontroldefault[i][GC_WEAPONPREV ][1] = KEY_HAT1+2; // D-Pad Left
|
||||
gamecontroldefault[i][GC_WEAPONNEXT ][1] = KEY_HAT1+3; // D-Pad Right
|
||||
gamecontroldefault[i][GC_VIEWPOINTNEXT][1] = KEY_JOY1+9; // Right Stick
|
||||
gamecontroldefault[i][GC_TOSSFLAG ][1] = KEY_HAT1+0; // D-Pad Up
|
||||
gamecontroldefault[i][GC_SCORES ][1] = KEY_HAT1+1; // D-Pad Down
|
||||
|
||||
// Second player controls only have joypad defaults
|
||||
gamecontrolbisdefault[i][GC_JUMP ][1] = KEY_2JOY1+0; // A
|
||||
gamecontrolbisdefault[i][GC_SPIN ][1] = KEY_2JOY1+2; // X
|
||||
gamecontrolbisdefault[i][GC_CUSTOM1 ][1] = KEY_2JOY1+1; // B
|
||||
gamecontrolbisdefault[i][GC_CUSTOM2 ][1] = KEY_2JOY1+3; // Y
|
||||
gamecontrolbisdefault[i][GC_CUSTOM3 ][1] = KEY_2JOY1+8; // Left Stick
|
||||
gamecontrolbisdefault[i][GC_CENTERVIEW ][1] = KEY_2JOY1+9; // Right Stick
|
||||
gamecontrolbisdefault[i][GC_WEAPONPREV ][1] = KEY_2JOY1+4; // LB
|
||||
gamecontrolbisdefault[i][GC_WEAPONNEXT ][1] = KEY_2JOY1+5; // RB
|
||||
gamecontrolbisdefault[i][GC_SCREENSHOT ][1] = KEY_2JOY1+6; // Back
|
||||
gamecontrolbisdefault[i][GC_JUMP ][1] = KEY_2JOY1+0; // A
|
||||
gamecontrolbisdefault[i][GC_SPIN ][1] = KEY_2JOY1+2; // X
|
||||
gamecontrolbisdefault[i][GC_CUSTOM1 ][1] = KEY_2JOY1+1; // B
|
||||
gamecontrolbisdefault[i][GC_CUSTOM2 ][1] = KEY_2JOY1+3; // Y
|
||||
gamecontrolbisdefault[i][GC_CUSTOM3 ][1] = KEY_2JOY1+8; // Left Stick
|
||||
gamecontrolbisdefault[i][GC_CAMTOGGLE ][1] = KEY_2JOY1+4; // LB
|
||||
gamecontrolbisdefault[i][GC_CENTERVIEW ][1] = KEY_2JOY1+5; // RB
|
||||
gamecontrolbisdefault[i][GC_SCREENSHOT ][1] = KEY_2JOY1+6; // Back
|
||||
//gamecontrolbisdefault[i][GC_SYSTEMMENU ][0] = KEY_2JOY1+7; // Start
|
||||
gamecontrolbisdefault[i][GC_CAMTOGGLE ][1] = KEY_2HAT1+0; // D-Pad Up
|
||||
gamecontrolbisdefault[i][GC_VIEWPOINTNEXT][1] = KEY_2HAT1+1; // D-Pad Down
|
||||
gamecontrolbisdefault[i][GC_TOSSFLAG ][1] = KEY_2HAT1+2; // D-Pad Left
|
||||
//gamecontrolbisdefault[i][GC_SCORES ][1] = KEY_2HAT1+3; // D-Pad Right
|
||||
gamecontrolbisdefault[i][GC_WEAPONPREV ][1] = KEY_2HAT1+2; // D-Pad Left
|
||||
gamecontrolbisdefault[i][GC_WEAPONNEXT ][1] = KEY_2HAT1+3; // D-Pad Right
|
||||
gamecontrolbisdefault[i][GC_VIEWPOINTNEXT][1] = KEY_2JOY1+9; // Right Stick
|
||||
gamecontrolbisdefault[i][GC_TOSSFLAG ][1] = KEY_2HAT1+0; // D-Pad Up
|
||||
//gamecontrolbisdefault[i][GC_SCORES ][1] = KEY_2HAT1+1; // D-Pad Down
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -993,7 +993,7 @@ static void setcontrol(INT32 (*gc)[2])
|
|||
{
|
||||
INT32 numctrl;
|
||||
const char *namectrl;
|
||||
INT32 keynum, keynum1, keynum2;
|
||||
INT32 keynum, keynum1, keynum2 = 0;
|
||||
INT32 player = ((void*)gc == (void*)&gamecontrolbis ? 1 : 0);
|
||||
boolean nestedoverride = false;
|
||||
|
||||
|
@ -1009,7 +1009,8 @@ static void setcontrol(INT32 (*gc)[2])
|
|||
return;
|
||||
}
|
||||
keynum1 = G_KeyNameToNum(COM_Argv(2));
|
||||
keynum2 = G_KeyNameToNum(COM_Argv(3));
|
||||
if (COM_Argc() > 3)
|
||||
keynum2 = G_KeyNameToNum(COM_Argv(3));
|
||||
keynum = G_FilterKeyByVersion(numctrl, 0, player, &keynum1, &keynum2, &nestedoverride);
|
||||
|
||||
if (keynum >= 0)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2020-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 2020-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2020-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 2020-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -89,7 +89,7 @@ typedef struct gl_vissprite_s
|
|||
|
||||
//Hurdler: 25/04/2000: now support colormap in hardware mode
|
||||
UINT8 *colormap;
|
||||
INT32 dispoffset; // copy of info->dispoffset, affects ordering but not drawing
|
||||
INT32 dispoffset; // copy of mobj->dispoffset, affects ordering but not drawing
|
||||
|
||||
patch_t *gpatch;
|
||||
mobj_t *mobj; // NOTE: This is a precipmobj_t if precip is true !!! Watch out.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -4151,7 +4151,7 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
|
|||
scale *= spr->shadowscale;
|
||||
|
||||
if (spr->rotateflags & SRF_3D || renderflags & RF_NOSPLATBILLBOARD)
|
||||
angle = spr->angle;
|
||||
angle = spr->mobj->angle;
|
||||
else
|
||||
angle = viewangle;
|
||||
|
||||
|
@ -4206,8 +4206,8 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
|
|||
// Translate
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
wallVerts[i].x = rotated[i].x + spr->x1;
|
||||
wallVerts[i].z = rotated[i].y + spr->z1;
|
||||
wallVerts[i].x = rotated[i].x + FIXED_TO_FLOAT(spr->mobj->x);
|
||||
wallVerts[i].z = rotated[i].y + FIXED_TO_FLOAT(spr->mobj->y);
|
||||
}
|
||||
|
||||
if (renderflags & (RF_SLOPESPLAT | RF_OBJECTSLOPESPLAT))
|
||||
|
@ -5097,7 +5097,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
return;
|
||||
}
|
||||
|
||||
dispoffset = thing->info->dispoffset;
|
||||
dispoffset = thing->dispoffset;
|
||||
|
||||
|
||||
if (R_UsingFrameInterpolation() && !paused)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1998-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2020-2022 by James R.
|
||||
// Copyright (C) 2020-2023 by James R.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -328,10 +328,10 @@ void HU_LoadGraphics(void)
|
|||
void HU_Init(void)
|
||||
{
|
||||
#ifndef NONET
|
||||
COM_AddCommand("say", Command_Say_f);
|
||||
COM_AddCommand("sayto", Command_Sayto_f);
|
||||
COM_AddCommand("sayteam", Command_Sayteam_f);
|
||||
COM_AddCommand("csay", Command_CSay_f);
|
||||
COM_AddCommand("say", Command_Say_f, COM_LUA);
|
||||
COM_AddCommand("sayto", Command_Sayto_f, COM_LUA);
|
||||
COM_AddCommand("sayteam", Command_Sayteam_f, COM_LUA);
|
||||
COM_AddCommand("csay", Command_CSay_f, COM_LUA);
|
||||
RegisterNetXCmd(XD_SAY, Got_Saycmd);
|
||||
#endif
|
||||
|
||||
|
@ -2994,7 +2994,7 @@ static void HU_DrawCoopOverlay(void)
|
|||
V_DrawSmallScaledPatch(148, 172, 0, tokenicon);
|
||||
}
|
||||
|
||||
if (LUA_HudEnabled(hud_tabemblems) && (!modifiedgame || savemoddata))
|
||||
if (LUA_HudEnabled(hud_tabemblems))
|
||||
{
|
||||
V_DrawString(160, 144, 0, va("- %d/%d", M_CountEmblems(), numemblems+numextraemblems));
|
||||
V_DrawScaledPatch(128, 144 - emblemicon->height/4, 0, emblemicon);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2011-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 2011-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2011-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 2011-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -40,7 +40,7 @@ extern UINT8 keyboard_started;
|
|||
|
||||
\return free memory in the system
|
||||
*/
|
||||
UINT32 I_GetFreeMem(UINT32 *total);
|
||||
size_t I_GetFreeMem(size_t *total);
|
||||
|
||||
/** \brief Returns precise time value for performance measurement. The precise
|
||||
time should be a monotonically increasing counter, and will wrap.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2020-2022 by James R.
|
||||
// Copyright (C) 2020-2023 by James R.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
18
src/i_time.c
18
src/i_time.c
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -43,18 +43,20 @@ tic_t I_GetTime(void)
|
|||
|
||||
void I_InitializeTime(void)
|
||||
{
|
||||
g_time.time = 0;
|
||||
g_time.timefrac = 0;
|
||||
|
||||
enterprecise = 0;
|
||||
oldenterprecise = 0;
|
||||
tictimer = 0.0;
|
||||
|
||||
CV_RegisterVar(&cv_timescale);
|
||||
|
||||
// I_StartupTimer is preserved for potential subsystems that need to setup
|
||||
// timing information for I_GetPreciseTime and sleeping
|
||||
I_StartupTimer();
|
||||
|
||||
g_time.time = 0;
|
||||
g_time.timefrac = 0;
|
||||
|
||||
enterprecise = I_GetPreciseTime();
|
||||
oldenterprecise = enterprecise;
|
||||
entertic = 0;
|
||||
oldentertics = 0;
|
||||
tictimer = 0.0;
|
||||
}
|
||||
|
||||
void I_UpdateTime(fixed_t timescale)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -3429,10 +3429,10 @@ state_t states[NUMSTATES] =
|
|||
{SPR_LCKN, 2|FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_LOCKONINF3
|
||||
{SPR_LCKN, 3|FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_LOCKONINF4
|
||||
|
||||
{SPR_TTAG, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_TTAG
|
||||
{SPR_TTAG, FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_NULL}, // S_TTAG
|
||||
|
||||
// CTF Sign
|
||||
{SPR_GFLG, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_GOTFLAG
|
||||
{SPR_GFLG, FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_NULL}, // S_GOTFLAG
|
||||
|
||||
// Finish flag
|
||||
{SPR_FNSF, FF_TRANS30, -1, {NULL}, 0, 0, S_NULL}, // S_FINISHFLAG
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2012-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2012-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 2012-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -874,6 +874,7 @@ static int lib_pGetClosestAxis(lua_State *L)
|
|||
|
||||
static int lib_pSpawnParaloop(lua_State *L)
|
||||
{
|
||||
mobj_t *ptmthing = tmthing;
|
||||
fixed_t x = luaL_checkfixed(L, 1);
|
||||
fixed_t y = luaL_checkfixed(L, 2);
|
||||
fixed_t z = luaL_checkfixed(L, 3);
|
||||
|
@ -890,6 +891,7 @@ static int lib_pSpawnParaloop(lua_State *L)
|
|||
if (nstate >= NUMSTATES)
|
||||
return luaL_error(L, "state %d out of range (0 - %d)", nstate, NUMSTATES-1);
|
||||
P_SpawnParaloop(x, y, z, radius, number, type, nstate, rotangle, spawncenter);
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2261,6 +2263,18 @@ static int lib_pMobjTouchingSectorSpecial(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int lib_pThingOnSpecial3DFloor(lua_State *L)
|
||||
{
|
||||
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
NOHUD
|
||||
INLEVEL
|
||||
if (!mo)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
LUA_Deprecated(L, "P_ThingOnSpecial3DFloor", "P_MobjTouchingSectorSpecial\" or \"P_MobjTouchingSectorSpecialFlag");
|
||||
LUA_PushUserdata(L, P_ThingOnSpecial3DFloor(mo), META_SECTOR);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_pMobjTouchingSectorSpecialFlag(lua_State *L)
|
||||
{
|
||||
mobj_t *mo = *((mobj_t**)luaL_checkudata(L, 1, META_MOBJ));
|
||||
|
@ -3529,7 +3543,6 @@ static int lib_gAddPlayer(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
|
||||
|
||||
newplayernum = i;
|
||||
|
||||
CL_ClearPlayer(newplayernum);
|
||||
|
@ -3541,9 +3554,6 @@ static int lib_gAddPlayer(lua_State *L)
|
|||
newplayer->jointime = 0;
|
||||
newplayer->quittime = 0;
|
||||
|
||||
// Set the bot name (defaults to Bot #)
|
||||
strcpy(player_names[newplayernum], va("Bot %d", botcount));
|
||||
|
||||
// Read the skin argument (defaults to Sonic)
|
||||
if (!lua_isnoneornil(L, 1))
|
||||
{
|
||||
|
@ -3555,7 +3565,10 @@ static int lib_gAddPlayer(lua_State *L)
|
|||
if (!lua_isnoneornil(L, 2))
|
||||
newplayer->skincolor = R_GetColorByName(luaL_checkstring(L, 2));
|
||||
else
|
||||
newplayer->skincolor = skins[newplayer->skin].prefcolor;
|
||||
newplayer->skincolor = skins[skinnum].prefcolor;
|
||||
|
||||
// Set the bot default name as the skin
|
||||
strcpy(player_names[newplayernum], skins[skinnum].realname);
|
||||
|
||||
// Read the bot name, if given
|
||||
if (!lua_isnoneornil(L, 3))
|
||||
|
@ -3571,14 +3584,19 @@ static int lib_gAddPlayer(lua_State *L)
|
|||
// Set the skin (can't do this until AFTER bot type is set!)
|
||||
SetPlayerSkinByNum(newplayernum, skinnum);
|
||||
|
||||
|
||||
if (netgame)
|
||||
{
|
||||
char joinmsg[256];
|
||||
|
||||
// Truncate bot name
|
||||
player_names[newplayernum][sizeof(*player_names) - 8] = '\0'; // The length of colored [BOT] + 1
|
||||
|
||||
strcpy(joinmsg, M_GetText("\x82*Bot %s has joined the game (player %d)"));
|
||||
strcpy(joinmsg, va(joinmsg, player_names[newplayernum], newplayernum));
|
||||
HU_AddChatText(joinmsg, false);
|
||||
|
||||
// Append blue [BOT] tag at the end
|
||||
strlcat(player_names[newplayernum], "\x84[BOT]\x80", sizeof(*player_names));
|
||||
}
|
||||
|
||||
LUA_PushUserdata(L, newplayer, META_PLAYER);
|
||||
|
@ -3612,6 +3630,16 @@ static int lib_gRemovePlayer(lua_State *L)
|
|||
}
|
||||
|
||||
|
||||
static int lib_gSetUsedCheats(lua_State *L)
|
||||
{
|
||||
// Let large-scale level packs using Lua be able to add cheat commands.
|
||||
boolean silent = lua_optboolean(L, 1);
|
||||
//NOHUD
|
||||
//INLEVEL
|
||||
G_SetUsedCheats(silent);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int Lcheckmapnumber (lua_State *L, int idx, const char *fun)
|
||||
{
|
||||
if (ISINLEVEL)
|
||||
|
@ -4132,6 +4160,7 @@ static luaL_Reg lib[] = {
|
|||
{"P_DoSuperTransformation",lib_pDoSuperTransformation},
|
||||
{"P_ExplodeMissile",lib_pExplodeMissile},
|
||||
{"P_MobjTouchingSectorSpecial",lib_pMobjTouchingSectorSpecial},
|
||||
{"P_ThingOnSpecial3DFloor",lib_pThingOnSpecial3DFloor},
|
||||
{"P_MobjTouchingSectorSpecialFlag",lib_pMobjTouchingSectorSpecialFlag},
|
||||
{"P_PlayerTouchingSectorSpecial",lib_pPlayerTouchingSectorSpecial},
|
||||
{"P_PlayerTouchingSectorSpecialFlag",lib_pPlayerTouchingSectorSpecialFlag},
|
||||
|
@ -4213,6 +4242,7 @@ static luaL_Reg lib[] = {
|
|||
{"G_AddGametype", lib_gAddGametype},
|
||||
{"G_AddPlayer", lib_gAddPlayer},
|
||||
{"G_RemovePlayer", lib_gRemovePlayer},
|
||||
{"G_SetUsedCheats", lib_gSetUsedCheats},
|
||||
{"G_BuildMapName",lib_gBuildMapName},
|
||||
{"G_BuildMapTitle",lib_gBuildMapTitle},
|
||||
{"G_FindMap",lib_gFindMap},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2016-2022 by Iestyn "Monster Iestyn" Jealous.
|
||||
// Copyright (C) 2016-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 2016-2023 by Iestyn "Monster Iestyn" Jealous.
|
||||
// Copyright (C) 2016-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2012-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2012-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 2012-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
@ -253,7 +253,7 @@ static int lib_comBufAddText(lua_State *L)
|
|||
plr = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||
if (plr && plr != &players[consoleplayer])
|
||||
return 0;
|
||||
COM_BufAddTextEx(va("%s\n", luaL_checkstring(L, 2)), COM_SAFE);
|
||||
COM_BufAddTextEx(va("%s\n", luaL_checkstring(L, 2)), COM_LUA);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -269,7 +269,7 @@ static int lib_comBufInsertText(lua_State *L)
|
|||
plr = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||
if (plr && plr != &players[consoleplayer])
|
||||
return 0;
|
||||
COM_BufInsertTextEx(va("%s\n", luaL_checkstring(L, 2)), COM_SAFE);
|
||||
COM_BufInsertTextEx(va("%s\n", luaL_checkstring(L, 2)), COM_LUA);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -450,6 +450,7 @@ static int lib_cvRegisterVar(lua_State *L)
|
|||
return luaL_error(L, M_GetText("Variable %s has CV_CALL without a function"), cvar->name);
|
||||
}
|
||||
|
||||
cvar->flags |= CV_ALLOWLUA;
|
||||
// actually time to register it to the console now! Finally!
|
||||
cvar->flags |= CV_MODIFIED;
|
||||
CV_RegisterVar(cvar);
|
||||
|
@ -478,7 +479,7 @@ static int CVarSetFunction
|
|||
){
|
||||
consvar_t *cvar = *(consvar_t **)luaL_checkudata(L, 1, META_CVAR);
|
||||
|
||||
if (cvar->flags & CV_NOLUA)
|
||||
if (!(cvar->flags & CV_ALLOWLUA))
|
||||
return luaL_error(L, "Variable '%s' cannot be set from Lua.", cvar->name);
|
||||
|
||||
switch (lua_type(L, 2))
|
||||
|
@ -510,7 +511,7 @@ static int lib_cvAddValue(lua_State *L)
|
|||
{
|
||||
consvar_t *cvar = *(consvar_t **)luaL_checkudata(L, 1, META_CVAR);
|
||||
|
||||
if (cvar->flags & CV_NOLUA)
|
||||
if (!(cvar->flags & CV_ALLOWLUA))
|
||||
return luaL_error(L, "Variable %s cannot be set from Lua.", cvar->name);
|
||||
|
||||
CV_AddValue(cvar, (INT32)luaL_checknumber(L, 2));
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2012-2016 by John "JTE" Muniz.
|
||||
// Copyright (C) 2012-2022 by Sonic Team Junior.
|
||||
// Copyright (C) 2012-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue