mirror of
https://github.com/UberGames/RPG-X2.git
synced 2024-11-25 05:42:18 +00:00
Updated README.txt
This commit is contained in:
parent
8041829d0a
commit
c8f750721c
21 changed files with 51 additions and 1517 deletions
23
README.txt
23
README.txt
|
@ -28,6 +28,12 @@ On Windows:
|
||||||
- make clean removes all compiled files (including the
|
- make clean removes all compiled files (including the
|
||||||
shared libraries)
|
shared libraries)
|
||||||
|
|
||||||
|
Cross Compiling for Windows:
|
||||||
|
Not yet but hopefully soon.
|
||||||
|
|
||||||
|
Mac OSX:
|
||||||
|
Not yet but hopefully soon.
|
||||||
|
|
||||||
Bug Reports and Patch/Feature Suggestions:
|
Bug Reports and Patch/Feature Suggestions:
|
||||||
--------------
|
--------------
|
||||||
We have a bug report system set up at http://bugs.rpg-x.net
|
We have a bug report system set up at http://bugs.rpg-x.net
|
||||||
|
@ -36,6 +42,10 @@ please let us know! Also if you fixed a bug in the code of
|
||||||
have coded a new feature feels free suggest us adding it
|
have coded a new feature feels free suggest us adding it
|
||||||
there (please upload a *.diff file).
|
there (please upload a *.diff file).
|
||||||
|
|
||||||
|
Note:
|
||||||
|
As the UberGames bug tracker is down right now use
|
||||||
|
http://bugs.hennecke-online.net instead.
|
||||||
|
|
||||||
|
|
||||||
Contact:
|
Contact:
|
||||||
--------------
|
--------------
|
||||||
|
@ -44,8 +54,11 @@ Come join our forum at http://forums.ubergames.net/
|
||||||
|
|
||||||
Legal Notice:
|
Legal Notice:
|
||||||
-------------
|
-------------
|
||||||
All assets used in this file are copyrighted to the RPG-X Mod and/or their
|
All assets used in this file and/or git repository are copyrighted
|
||||||
original creators. Any external use of these assets without explicit permission
|
to the UberGames and/or their original creators. Any external
|
||||||
from their original creators is not allowed.
|
use of these assets without explicit permission from their original
|
||||||
The RPG-X Mod and its creators cannot be held accountable for any damage that
|
creators is not allowed. Feel free to use the source code included
|
||||||
may have been caused by playing the game.
|
in this file and/or git repository for your own mod as long as you
|
||||||
|
give full credit to UberGames. The Ubergames and other conributers
|
||||||
|
to the RPG-X Mod cannot be held accountable for any damage that may
|
||||||
|
have been caused by playing the game.
|
||||||
|
|
|
@ -954,19 +954,24 @@ void CG_InitConsoleCommands( void ) {
|
||||||
/* temp */
|
/* temp */
|
||||||
trap_AddCommand("ui_holodeck");
|
trap_AddCommand("ui_holodeck");
|
||||||
|
|
||||||
#ifdef XTRA
|
/*
|
||||||
|
* note:
|
||||||
|
* - some of these might get removed
|
||||||
|
* - some of these don't require rpgxEF anymore
|
||||||
|
* and will be merged into the non rpgxEF version
|
||||||
|
*/
|
||||||
trap_AddCommand("userlogin");
|
trap_AddCommand("userlogin");
|
||||||
trap_AddCommand("userAdd");
|
trap_AddCommand("userAdd");
|
||||||
trap_AddCommand("sql_setup");
|
trap_AddCommand("sql_setup");
|
||||||
trap_AddCommand("userMod");
|
trap_AddCommand("userMod");
|
||||||
trap_AddCommand("userDel");
|
trap_AddCommand("userDel");
|
||||||
#endif
|
|
||||||
|
|
||||||
|
/* lua */
|
||||||
#ifdef CG_LUA
|
#ifdef CG_LUA
|
||||||
trap_AddCommand("lua_status");
|
trap_AddCommand("lua_status");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* CCAM */
|
/* Cinematic Cam testing */
|
||||||
trap_AddCommand("camtest");
|
trap_AddCommand("camtest");
|
||||||
trap_AddCommand("camtestend");
|
trap_AddCommand("camtestend");
|
||||||
}
|
}
|
||||||
|
|
|
@ -2493,8 +2493,7 @@ void CG_InitLensFlare( vec3_t worldCoord,
|
||||||
//TiM - Allow parts of the lerp code to update the 3rd view if need be
|
//TiM - Allow parts of the lerp code to update the 3rd view if need be
|
||||||
void CG_ResetThirdPersonViewDamp ( void );
|
void CG_ResetThirdPersonViewDamp ( void );
|
||||||
|
|
||||||
#ifdef XTRA
|
/* shader remapping */
|
||||||
void trap_R_RemapShader( const char *oldShader, const char *newShader, const char *timeOffset );
|
void trap_R_RemapShader( const char *oldShader, const char *newShader, const char *timeOffset );
|
||||||
void CG_ShaderStateChanged(void);
|
void CG_ShaderStateChanged(void);
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -1826,9 +1826,8 @@ void CG_Init( int serverMessageNum, int serverCommandSequence ) {
|
||||||
//TiM2 - Separated this out so class data has to be locally accessed now
|
//TiM2 - Separated this out so class data has to be locally accessed now
|
||||||
//CG_ParseClassData();
|
//CG_ParseClassData();
|
||||||
|
|
||||||
#ifdef XTRA
|
/* shader remapping */
|
||||||
CG_ShaderStateChanged();
|
CG_ShaderStateChanged();
|
||||||
#endif
|
|
||||||
|
|
||||||
if(grp_berp.integer)
|
if(grp_berp.integer)
|
||||||
CG_Printf(S_COLOR_YELLOW "GSIO01 and Ubergames greet Brave Explorers.\n");
|
CG_Printf(S_COLOR_YELLOW "GSIO01 and Ubergames greet Brave Explorers.\n");
|
||||||
|
|
|
@ -7,9 +7,6 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
// rpgxEF?
|
|
||||||
#define XTRA 1
|
|
||||||
|
|
||||||
#define CMD_BACKUP 64
|
#define CMD_BACKUP 64
|
||||||
#define CMD_MASK (CMD_BACKUP - 1)
|
#define CMD_MASK (CMD_BACKUP - 1)
|
||||||
// allow a lot of command backups for very fast systems
|
// allow a lot of command backups for very fast systems
|
||||||
|
@ -126,10 +123,7 @@ typedef enum {
|
||||||
CG_CEIL,
|
CG_CEIL,
|
||||||
CG_TESTPRINTINT,
|
CG_TESTPRINTINT,
|
||||||
CG_TESTPRINTFLOAT,
|
CG_TESTPRINTFLOAT,
|
||||||
|
|
||||||
#ifdef XTRA
|
|
||||||
CG_R_REMAP_SHADER = 200,
|
CG_R_REMAP_SHADER = 200,
|
||||||
#endif
|
|
||||||
} cgameImport_t;
|
} cgameImport_t;
|
||||||
//these must match up with cg_syscalls.asm
|
//these must match up with cg_syscalls.asm
|
||||||
|
|
||||||
|
|
|
@ -340,12 +340,9 @@ static void CG_ConfigStringModified( void ) {
|
||||||
cgs.redflag = str[0] - '0';
|
cgs.redflag = str[0] - '0';
|
||||||
cgs.blueflag = str[1] - '0';
|
cgs.blueflag = str[1] - '0';
|
||||||
}
|
}
|
||||||
#ifdef XTRA
|
|
||||||
else if(num == CS_SHADERSTATE) {
|
else if(num == CS_SHADERSTATE) {
|
||||||
CG_ShaderStateChanged();
|
CG_ShaderStateChanged();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -618,7 +615,6 @@ char *ConcatArgs2( int start ) {
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XTRA
|
|
||||||
/*
|
/*
|
||||||
=====================
|
=====================
|
||||||
CG_ShaderStateChanged
|
CG_ShaderStateChanged
|
||||||
|
@ -661,7 +657,6 @@ void CG_ShaderStateChanged(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -866,7 +861,7 @@ static void CG_ServerCommand( void ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XTRA
|
/* shader remap */
|
||||||
if ( Q_stricmp (cmd, "remapShader") == 0 )
|
if ( Q_stricmp (cmd, "remapShader") == 0 )
|
||||||
{
|
{
|
||||||
if (trap_Argc() == 4)
|
if (trap_Argc() == 4)
|
||||||
|
@ -884,7 +879,6 @@ static void CG_ServerCommand( void ) {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if(!strcmp(cmd, "ui_transporter")) {
|
if(!strcmp(cmd, "ui_transporter")) {
|
||||||
trap_SendConsoleCommand(va("ui_transporter %s", CG_Argv(1)));
|
trap_SendConsoleCommand(va("ui_transporter %s", CG_Argv(1)));
|
||||||
|
@ -906,12 +900,11 @@ static void CG_ServerCommand( void ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XTRA
|
/* TODO remove me? */
|
||||||
if(!strcmp(cmd, "sqlkey")) {
|
if(!strcmp(cmd, "sqlkey")) {
|
||||||
trap_SendClientCommand(va("sqlkey %i", CG_Argv(1)));
|
trap_SendClientCommand(va("sqlkey %i", CG_Argv(1)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
CG_Printf( "Unknown client game command: %s\n", cmd );
|
CG_Printf( "Unknown client game command: %s\n", cmd );
|
||||||
}
|
}
|
||||||
|
|
|
@ -286,8 +286,8 @@ int trap_MemoryRemaining( void ) {
|
||||||
return syscall( CG_MEMORY_REMAINING );
|
return syscall( CG_MEMORY_REMAINING );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XTRA
|
/* shader remap */
|
||||||
void trap_R_RemapShader( const char *oldShader, const char *newShader, const char *timeOffset ) {
|
void trap_R_RemapShader( const char *oldShader, const char *newShader, const char *timeOffset ) {
|
||||||
syscall( CG_R_REMAP_SHADER, oldShader, newShader, timeOffset );
|
syscall( CG_R_REMAP_SHADER, oldShader, newShader, timeOffset );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
|
@ -6,11 +6,7 @@
|
||||||
|
|
||||||
#define MAX_DLIGHTS 32 // can't be increased, because bit flags are used on surfaces
|
#define MAX_DLIGHTS 32 // can't be increased, because bit flags are used on surfaces
|
||||||
|
|
||||||
#ifndef XTRA
|
|
||||||
#define ENTITYNUM_BITS 10 // can't be increased without changing drawsurf bit packing
|
|
||||||
#else
|
|
||||||
#define ENTITYNUM_BITS 11 // can't be increased without changing drawsurf bit packing
|
#define ENTITYNUM_BITS 11 // can't be increased without changing drawsurf bit packing
|
||||||
#endif
|
|
||||||
#define MAX_ENTITIES ((1<<ENTITYNUM_BITS) - 1)
|
#define MAX_ENTITIES ((1<<ENTITYNUM_BITS) - 1)
|
||||||
|
|
||||||
// renderfx flags
|
// renderfx flags
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
//
|
//
|
||||||
// bg_public.h -- definitions shared by both the server game and client game modules
|
// bg_public.h -- definitions shared by both the server game and client game modules
|
||||||
|
|
||||||
// are we compiling for rpgxEF?
|
|
||||||
#define XTRA 1
|
|
||||||
// meh somehow preprocessor G_LUA won't work for me
|
// meh somehow preprocessor G_LUA won't work for me
|
||||||
#define G_LUA 1
|
#define G_LUA 1
|
||||||
#define CG_LUA 1
|
#define CG_LUA 1
|
||||||
|
@ -169,9 +167,8 @@ typedef enum
|
||||||
#define CS_RED_GROUP 16 //!< used to send down what the group the red team is
|
#define CS_RED_GROUP 16 //!< used to send down what the group the red team is
|
||||||
#define CS_BLUE_GROUP 17 //!< used to send down what the group the blue team is
|
#define CS_BLUE_GROUP 17 //!< used to send down what the group the blue team is
|
||||||
|
|
||||||
#ifdef XTRA
|
/** shader remapping info */
|
||||||
#define CS_SHADERSTATE 18
|
#define CS_SHADERSTATE 18
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CS_ITEMS 27 //!< string of 0's and 1's that tell which items are present
|
#define CS_ITEMS 27 //!< string of 0's and 1's that tell which items are present
|
||||||
//TiM: Ooooh! a gap between 27 + 32! Exploitationism!
|
//TiM: Ooooh! a gap between 27 + 32! Exploitationism!
|
||||||
|
|
108
game/g_client.c
108
game/g_client.c
|
@ -773,110 +773,6 @@ given a race name, go find all the skins that use it, and randomly select one
|
||||||
/**
|
/**
|
||||||
* given a race name, go find all the skins that use it, and randomly select one
|
* given a race name, go find all the skins that use it, and randomly select one
|
||||||
*/
|
*/
|
||||||
#ifdef Q3_VM
|
|
||||||
void randomSkin(const char* race, char* model, int current_team, int clientNum)
|
|
||||||
{
|
|
||||||
char skinsForRace[MAX_SKINS_FOR_RACE][128];
|
|
||||||
int howManySkins = 0;
|
|
||||||
int i,x;
|
|
||||||
int temp;
|
|
||||||
int skin_count_check;
|
|
||||||
char skinNamesAlreadyUsed[16][128];
|
|
||||||
int current_skin_count = 0;
|
|
||||||
gentity_t *ent = NULL;
|
|
||||||
char userinfo[MAX_INFO_STRING];
|
|
||||||
char temp_model[MAX_QPATH];
|
|
||||||
|
|
||||||
memset(skinsForRace, 0, sizeof(skinsForRace));
|
|
||||||
memset(skinNamesAlreadyUsed, 0, sizeof(skinNamesAlreadyUsed));
|
|
||||||
|
|
||||||
// first up, check to see if we want to select a skin from someone that's already playing on this guys team
|
|
||||||
skin_count_check = g_random_skin_limit.integer;
|
|
||||||
if (skin_count_check)
|
|
||||||
{
|
|
||||||
// sanity check the skins to compare against count
|
|
||||||
if (skin_count_check > 16)
|
|
||||||
{
|
|
||||||
skin_count_check = 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
// now construct an array of the names already used
|
|
||||||
for (i=0; i<g_maxclients.integer; i++)
|
|
||||||
{
|
|
||||||
// did we find enough skins to grab a random one from yet?
|
|
||||||
if (current_skin_count == skin_count_check)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
ent = g_entities + i;
|
|
||||||
if (!ent->inuse || i == clientNum)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// no, so look at the next one, and see if it's in the list we are constructing
|
|
||||||
// same team?
|
|
||||||
if (ent->client && ent->client->sess.sessionTeam == current_team)
|
|
||||||
{
|
|
||||||
// so what's this clients model then?
|
|
||||||
trap_GetUserinfo( i, userinfo, sizeof( userinfo ) );
|
|
||||||
Q_strncpyz( temp_model, Info_ValueForKey (userinfo, "model"), sizeof( temp_model ) );
|
|
||||||
|
|
||||||
// check the name
|
|
||||||
for (x = 0; x< current_skin_count; x++)
|
|
||||||
{
|
|
||||||
// are we the same?
|
|
||||||
if (!Q_stricmp(skinNamesAlreadyUsed[x], temp_model))
|
|
||||||
{
|
|
||||||
// yeah - ok we already got this one
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ok, did we match anything?
|
|
||||||
if (x == current_skin_count)
|
|
||||||
{
|
|
||||||
// no - better add this name in
|
|
||||||
Q_strncpyz(skinNamesAlreadyUsed[current_skin_count], temp_model, sizeof(skinNamesAlreadyUsed[current_skin_count]));
|
|
||||||
current_skin_count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ok, array constructed. Did we get enough?
|
|
||||||
if (current_skin_count >= skin_count_check)
|
|
||||||
{
|
|
||||||
// yeah, we did - so select a skin from one of these then
|
|
||||||
temp = rand() % current_skin_count;
|
|
||||||
Q_strncpyz( model, skinNamesAlreadyUsed[temp], MAX_QPATH );
|
|
||||||
ForceClientSkin(model, "");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// search through each and every skin we can find
|
|
||||||
for (i=0; i<group_count && howManySkins < MAX_SKINS_FOR_RACE; i++)
|
|
||||||
{
|
|
||||||
|
|
||||||
// if this models race list contains the race we want, then add it to the list
|
|
||||||
if (legalSkin(group_list[i].text, race))
|
|
||||||
{
|
|
||||||
Q_strncpyz( skinsForRace[howManySkins++], group_list[i].name , 128 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// set model to a random one
|
|
||||||
if (howManySkins)
|
|
||||||
{
|
|
||||||
temp = rand() % howManySkins;
|
|
||||||
Q_strncpyz( model, skinsForRace[temp], MAX_QPATH );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
model[0] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
void randomSkin(const char* race, char* model, int current_team, int clientNum)
|
void randomSkin(const char* race, char* model, int current_team, int clientNum)
|
||||||
{
|
{
|
||||||
char **skinsForRace;
|
char **skinsForRace;
|
||||||
|
@ -1002,7 +898,6 @@ void randomSkin(const char* race, char* model, int current_team, int clientNum)
|
||||||
free(skinNamesAlreadyUsed);
|
free(skinNamesAlreadyUsed);
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===========
|
===========
|
||||||
|
@ -1950,13 +1845,12 @@ void ClientBegin( int clientNum, qboolean careAboutWarmup, qboolean isBot, qbool
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XTRA
|
/* TODO remove me? */
|
||||||
if(sql_use.integer) {
|
if(sql_use.integer) {
|
||||||
int key = (byte)irandom(4096, 65535);
|
int key = (byte)irandom(4096, 65535);
|
||||||
ent->client->sqlkey = (byte)key;
|
ent->client->sqlkey = (byte)key;
|
||||||
trap_SendServerCommand(ent-g_entities, va("sqlkey \"%i\"", key));
|
trap_SendServerCommand(ent-g_entities, va("sqlkey \"%i\"", key));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// WEAPONS - PHENIX1
|
// WEAPONS - PHENIX1
|
||||||
|
|
|
@ -361,10 +361,8 @@ struct gentity_s {
|
||||||
//*core, // -->falsetarget
|
//*core, // -->falsetarget
|
||||||
//*coreSwap; // -->bluename
|
//*coreSwap; // -->bluename
|
||||||
|
|
||||||
#ifdef XTRA
|
|
||||||
char *targetShaderName; //!< shader to remap for shader remapping
|
char *targetShaderName; //!< shader to remap for shader remapping
|
||||||
char *targetShaderNewName; //!< shader to remap to for shader remapping
|
char *targetShaderNewName; //!< shader to remap to for shader remapping
|
||||||
#endif
|
|
||||||
|
|
||||||
qboolean tmpEntity; //!< is this a temporal entity?
|
qboolean tmpEntity; //!< is this a temporal entity?
|
||||||
#ifdef G_LUA
|
#ifdef G_LUA
|
||||||
|
@ -602,12 +600,10 @@ struct gclient_s {
|
||||||
qboolean *universalTrans;*/
|
qboolean *universalTrans;*/
|
||||||
languageData_t *languages;
|
languageData_t *languages;
|
||||||
|
|
||||||
#ifdef XTRA
|
|
||||||
// for sql
|
// for sql
|
||||||
char *userName; //!< username (not player name) in the sql database
|
char *userName; //!< username (not player name) in the sql database
|
||||||
int uid; //!< uiser id of the player in the sql database
|
int uid; //!< uiser id of the player in the sql database
|
||||||
byte sqlkey; //!< random key used to make transmission of the username and password from the ui at least a bit safer
|
byte sqlkey; //!< random key used to make transmission of the username and password from the ui at least a bit safer
|
||||||
#endif
|
|
||||||
|
|
||||||
// CCAM
|
// CCAM
|
||||||
vec3_t origViewAngles;
|
vec3_t origViewAngles;
|
||||||
|
@ -839,9 +835,8 @@ int G_GetEntityByTargetname(const char *targetname, gentity_t *entities[MAX_GENT
|
||||||
int G_GetEntityByTarget(const char *target, gentity_t *entities[MAX_GENTITIES]);
|
int G_GetEntityByTarget(const char *target, gentity_t *entities[MAX_GENTITIES]);
|
||||||
int G_GetEntityByBmodel(char *bmodel, gentity_t *entities[MAX_GENTITIES]);
|
int G_GetEntityByBmodel(char *bmodel, gentity_t *entities[MAX_GENTITIES]);
|
||||||
|
|
||||||
#ifdef XTRA
|
/* shader remapping */
|
||||||
void AddRemap(const char *oldShader, const char *newShader, float timeOffset);
|
void AddRemap(const char *oldShader, const char *newShader, float timeOffset);
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// g_combat.c
|
// g_combat.c
|
||||||
|
@ -1546,7 +1541,7 @@ extern vmCvar_t rpg_server6;
|
||||||
// SP level change
|
// SP level change
|
||||||
extern vmCvar_t rpg_allowSPLevelChange;
|
extern vmCvar_t rpg_allowSPLevelChange;
|
||||||
|
|
||||||
#ifdef XTRA
|
/* TODO some can be removed */
|
||||||
extern vmCvar_t sql_dbName;
|
extern vmCvar_t sql_dbName;
|
||||||
extern vmCvar_t sql_use;
|
extern vmCvar_t sql_use;
|
||||||
extern vmCvar_t sql_server;
|
extern vmCvar_t sql_server;
|
||||||
|
@ -1554,7 +1549,6 @@ extern vmCvar_t sql_user;
|
||||||
extern vmCvar_t sql_password;
|
extern vmCvar_t sql_password;
|
||||||
extern vmCvar_t sql_port;
|
extern vmCvar_t sql_port;
|
||||||
extern vmCvar_t sql_hash;
|
extern vmCvar_t sql_hash;
|
||||||
#endif
|
|
||||||
|
|
||||||
// developer tools
|
// developer tools
|
||||||
extern vmCvar_t dev_showTriggers;
|
extern vmCvar_t dev_showTriggers;
|
||||||
|
@ -2036,12 +2030,10 @@ struct srvChangeData_s {
|
||||||
char bspname[16][MAX_QPATH];
|
char bspname[16][MAX_QPATH];
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef XTRA
|
|
||||||
/**
|
/**
|
||||||
* Builds the config string for shader remapping.
|
* Builds the config string for shader remapping.
|
||||||
*/
|
*/
|
||||||
const char *BuildShaderStateConfig(void);
|
const char *BuildShaderStateConfig(void);
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct luaAlertState_s luaAlertState_t;
|
typedef struct luaAlertState_s luaAlertState_t;
|
||||||
struct luaAlertState_s {
|
struct luaAlertState_s {
|
||||||
|
|
796
game/g_main.c
796
game/g_main.c
|
@ -338,7 +338,7 @@ vmCvar_t rpg_server6;
|
||||||
//! Allow target_levelchange to change the current level?
|
//! Allow target_levelchange to change the current level?
|
||||||
vmCvar_t rpg_allowSPLevelChange;
|
vmCvar_t rpg_allowSPLevelChange;
|
||||||
|
|
||||||
#ifdef XTRA
|
/* TODO some can be removed */
|
||||||
vmCvar_t sql_dbName; //!< Name of the SQL Database
|
vmCvar_t sql_dbName; //!< Name of the SQL Database
|
||||||
vmCvar_t sql_use; //!< Use SQL? 1 = mysql, 2 = sqlite
|
vmCvar_t sql_use; //!< Use SQL? 1 = mysql, 2 = sqlite
|
||||||
vmCvar_t sql_server; //!< SQL server to connect to (only mysql)
|
vmCvar_t sql_server; //!< SQL server to connect to (only mysql)
|
||||||
|
@ -613,7 +613,7 @@ static cvarTable_t gameCvarTable[] = {
|
||||||
|
|
||||||
{ &dev_showTriggers, "dev_showTriggers", "0", CVAR_ARCHIVE, 0, qfalse }
|
{ &dev_showTriggers, "dev_showTriggers", "0", CVAR_ARCHIVE, 0, qfalse }
|
||||||
|
|
||||||
#ifdef XTRA
|
/* TODO some can be removed */
|
||||||
,
|
,
|
||||||
{ &sql_dbName, "sql_dbName", "rpgx", CVAR_ARCHIVE, 0, qfalse },
|
{ &sql_dbName, "sql_dbName", "rpgx", CVAR_ARCHIVE, 0, qfalse },
|
||||||
{ &sql_use, "sql_use", "0", CVAR_ARCHIVE, 0, qfalse },
|
{ &sql_use, "sql_use", "0", CVAR_ARCHIVE, 0, qfalse },
|
||||||
|
@ -788,270 +788,6 @@ and parses the class data
|
||||||
for utilization on the server
|
for utilization on the server
|
||||||
and transfer to clients
|
and transfer to clients
|
||||||
**************************/
|
**************************/
|
||||||
#ifdef Q3_VM
|
|
||||||
static qboolean G_LoadClassData( char* fileName )
|
|
||||||
{
|
|
||||||
char buffer[32000];
|
|
||||||
char *textPtr, *token;
|
|
||||||
int fileLen;
|
|
||||||
fileHandle_t f;
|
|
||||||
qboolean classValid=qfalse;
|
|
||||||
int classIndex=0;
|
|
||||||
int weapon;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
//Init the storage place
|
|
||||||
memset( &g_classData, 0, sizeof ( g_classData ) );
|
|
||||||
|
|
||||||
fileLen = trap_FS_FOpenFile( fileName, &f, FS_READ );
|
|
||||||
|
|
||||||
if ( !f ) {
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: File %s not found.\n", fileName );
|
|
||||||
return qfalse;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( fileLen >= sizeof( buffer ) ) {
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: File %s was way too big.\n", fileName );
|
|
||||||
trap_FS_FCloseFile( f );
|
|
||||||
return qfalse;
|
|
||||||
}
|
|
||||||
|
|
||||||
trap_FS_Read( buffer, fileLen, f );
|
|
||||||
buffer[fileLen] = 0;
|
|
||||||
trap_FS_FCloseFile( f );
|
|
||||||
|
|
||||||
COM_BeginParseSession();
|
|
||||||
|
|
||||||
textPtr = buffer;
|
|
||||||
|
|
||||||
token = COM_Parse( &textPtr );
|
|
||||||
|
|
||||||
if ( !token[0] ) {
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: No data was found when going to parse the file!\n" );
|
|
||||||
return qfalse;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( Q_stricmpn( token, "{", 1 ) ) {
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: File did not start with a '{' symbol!\n" );
|
|
||||||
return qfalse;
|
|
||||||
}
|
|
||||||
|
|
||||||
while ( 1 )
|
|
||||||
{
|
|
||||||
if ( classIndex >= MAX_CLASSES )
|
|
||||||
break;
|
|
||||||
|
|
||||||
if ( !Q_stricmpn( token, "{", 1 ) )
|
|
||||||
{
|
|
||||||
while ( 1 )
|
|
||||||
{
|
|
||||||
token = COM_Parse( &textPtr );
|
|
||||||
if (!token[0]) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !Q_stricmpn( token, "consoleName", 11 ) )
|
|
||||||
{
|
|
||||||
if ( COM_ParseString( &textPtr, &token ) )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: Invalid class console name in class index: %i.\n", classIndex );
|
|
||||||
SkipBracedSection( &textPtr );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Q_strncpyz( g_classData[classIndex].consoleName, token, sizeof( g_classData[classIndex].consoleName ) );
|
|
||||||
classValid = qtrue;
|
|
||||||
|
|
||||||
//G_Printf( S_COLOR_RED "%s\n", g_classData[classIndex].consoleName );
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !Q_stricmpn( token, "formalName", 11 ) )
|
|
||||||
{
|
|
||||||
if ( COM_ParseString( &textPtr, &token ) )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: Invalid class formal name in class index: %i.\n", classIndex );
|
|
||||||
SkipBracedSection( &textPtr );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Q_strncpyz( g_classData[classIndex].formalName, token, sizeof( g_classData[classIndex].formalName ) );
|
|
||||||
classValid = qtrue;
|
|
||||||
|
|
||||||
//G_Printf( S_COLOR_RED "%s\n", g_classData[classIndex].consoleName );
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !Q_stricmpn( token, "message", 7 ) )
|
|
||||||
{
|
|
||||||
if ( COM_ParseString( &textPtr, &token ) )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: Invalid class message in class index: %i.\n", classIndex );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Q_strncpyz( g_classData[classIndex].message, token, sizeof( g_classData[classIndex].message ) );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !Q_stricmpn( token, "modelSkin", 9 ) )
|
|
||||||
{
|
|
||||||
if ( COM_ParseString( &textPtr, &token ) )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: Invalid class skin color in class index: %i.\n", classIndex );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Q_strncpyz( g_classData[classIndex].modelSkin, token, sizeof( g_classData[classIndex].modelSkin ) );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !Q_stricmpn( token, "weapons", 7) )
|
|
||||||
{
|
|
||||||
token = COM_Parse( &textPtr );
|
|
||||||
|
|
||||||
if ( Q_stricmpn( token, "{", 1 ) )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "No opening bracket found for weapons field in class: %i.\n", classIndex );
|
|
||||||
SkipRestOfLine( &textPtr );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
//sub loop
|
|
||||||
while ( 1 )
|
|
||||||
{
|
|
||||||
token = COM_Parse( &textPtr );
|
|
||||||
|
|
||||||
if ( !token[0] )
|
|
||||||
break;
|
|
||||||
|
|
||||||
if ( !Q_stricmpn( token, "|", 1 ) )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if ( !Q_stricmpn( token, "}", 1 ) )
|
|
||||||
break;
|
|
||||||
|
|
||||||
if( !Q_stricmpn( token, "WP_", 3 ) )
|
|
||||||
{
|
|
||||||
weapon = GetIDForString( WeaponTable, token );
|
|
||||||
|
|
||||||
if ( weapon >= 0 )
|
|
||||||
{
|
|
||||||
g_classData[classIndex].weaponsFlags |= ( 1 << weapon );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !Q_stricmpn( token, "admin", 5 ) )
|
|
||||||
{
|
|
||||||
if ( COM_ParseInt( &textPtr, &g_classData[classIndex].isAdmin ) )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: Class admin check for class %i was invalid.\n", classIndex );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !Q_stricmpn( token, "marine", 6 ) )
|
|
||||||
{
|
|
||||||
if ( COM_ParseInt( &textPtr, &g_classData[classIndex].isMarine ) )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: Class marine check for class %i was invalid.\n", classIndex );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !Q_stricmpn( token, "medical", 7 ) )
|
|
||||||
{
|
|
||||||
if ( COM_ParseInt( &textPtr, &g_classData[classIndex].isMedical ) )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: Class medic check for class %i was invalid.\n", classIndex );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !Q_stricmpn( token, "isBorg", 6 ) )
|
|
||||||
{
|
|
||||||
if( COM_ParseInt( &textPtr, &g_classData[classIndex].isBorg ) )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: Class borg check for class %i was invalid.\n", classIndex );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !Q_stricmpn( token, "n00b", 4 ) )
|
|
||||||
{
|
|
||||||
if ( COM_ParseInt( &textPtr, &g_classData[classIndex].isn00b ) )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: Class n00b check for class %i was invalid.\n", classIndex );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
//skip the client-side specific entries since they interfere with the parsing
|
|
||||||
if ( !Q_stricmpn( token, "radarColor", 10 )
|
|
||||||
|| !Q_stricmpn( token, "iconColor", 9 )
|
|
||||||
|| !Q_stricmpn( token, "hasRanks", 8 )
|
|
||||||
|| !Q_stricmpn( token, "noShow", 6 )
|
|
||||||
)
|
|
||||||
{
|
|
||||||
SkipRestOfLine( &textPtr );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !Q_stricmpn( token, "}", 1 ) )
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if ( classValid )
|
|
||||||
{
|
|
||||||
classIndex++;
|
|
||||||
classValid = qfalse;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
token = COM_Parse( &textPtr );
|
|
||||||
if (!token[0])
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//build ourselves custom CVARs for each class
|
|
||||||
for ( i=0; g_classData[i].consoleName[0] && i < MAX_CLASSES; i++ )
|
|
||||||
{
|
|
||||||
trap_Cvar_Register( NULL, va("rpg_%sPass", g_classData[i].consoleName ), g_classData[i].consoleName, CVAR_ARCHIVE );
|
|
||||||
trap_Cvar_Register( NULL, va("rpg_%sFlags", g_classData[i].consoleName ), va("%i", g_classData[i].weaponsFlags), CVAR_ARCHIVE );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( classIndex > 0 )
|
|
||||||
{
|
|
||||||
return qtrue;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: No valid classes were found.\n");
|
|
||||||
return qfalse;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static qboolean G_LoadClassData( char* fileName )
|
static qboolean G_LoadClassData( char* fileName )
|
||||||
{
|
{
|
||||||
char *buffer;
|
char *buffer;
|
||||||
|
@ -1326,137 +1062,12 @@ static qboolean G_LoadClassData( char* fileName )
|
||||||
return qfalse;
|
return qfalse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void BG_LanguageFilename(char *baseName,char *baseExtension,char *finalName);
|
void BG_LanguageFilename(char *baseName,char *baseExtension,char *finalName);
|
||||||
void SP_target_location (gentity_t *ent);
|
void SP_target_location (gentity_t *ent);
|
||||||
|
|
||||||
holoData_t holoData;
|
holoData_t holoData;
|
||||||
|
|
||||||
#ifdef Q3_VM
|
|
||||||
void G_LoadHolodeckFile(void) {
|
|
||||||
char fileRoute[MAX_QPATH];
|
|
||||||
char mapRoute[MAX_QPATH];
|
|
||||||
char info[MAX_INFO_STRING];
|
|
||||||
fileHandle_t f;
|
|
||||||
char buffer[20000];
|
|
||||||
int file_len;
|
|
||||||
char *txtPtr, *token;
|
|
||||||
int numProgs = 0;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
//get the map name out of the server data
|
|
||||||
trap_GetServerinfo( info, sizeof( info ) );
|
|
||||||
|
|
||||||
//setup the file route
|
|
||||||
Com_sprintf( mapRoute, sizeof( mapRoute ), "maps/%s", Info_ValueForKey( info, "mapname" ) );
|
|
||||||
|
|
||||||
BG_LanguageFilename( mapRoute, "holodeck", fileRoute );
|
|
||||||
|
|
||||||
file_len = trap_FS_FOpenFile( fileRoute, &f, FS_READ );
|
|
||||||
|
|
||||||
if ( !file_len )
|
|
||||||
return;
|
|
||||||
|
|
||||||
memset( buffer, 0, sizeof(buffer) );
|
|
||||||
|
|
||||||
trap_FS_Read( buffer, file_len, f );
|
|
||||||
if ( !buffer[0] )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: Couldn't read in file: %s!\n", fileRoute );
|
|
||||||
trap_FS_FCloseFile( f );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
buffer[file_len] = '\0';
|
|
||||||
trap_FS_FCloseFile( f );
|
|
||||||
|
|
||||||
COM_BeginParseSession();
|
|
||||||
txtPtr = buffer;
|
|
||||||
|
|
||||||
while(1) {
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
if(!token[0]) break;
|
|
||||||
|
|
||||||
if(!Q_stricmpn(token, "HolodeckData", 12)) {
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
if(Q_stricmpn(token, "{", 1)) {
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: HolodeckData had no opening brace ( { )!\n");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
while(Q_stricmpn(token, "}", 1)) {
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
if(!token[0]) break;
|
|
||||||
|
|
||||||
if(!Q_stricmpn(token, "Program", 7)) {
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
if(Q_stricmpn(token, "[", 1)) {
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: Program had no opening brace ( [ )!\n");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// expected format:
|
|
||||||
// <string> - target notnull
|
|
||||||
// <string> - name
|
|
||||||
// <string> - desc1
|
|
||||||
// <string> - desc2
|
|
||||||
// <string> - image
|
|
||||||
// <string> - iTrigger
|
|
||||||
// <string> - dTrigger
|
|
||||||
while(Q_stricmpn(token, "]", 1)) {
|
|
||||||
if(!token[0]) break;
|
|
||||||
|
|
||||||
if(numProgs >= 5) return;
|
|
||||||
|
|
||||||
// targetname of info_notnull
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
Q_strncpyz(holoData.target[numProgs], token, sizeof(holoData.target[numProgs]));
|
|
||||||
|
|
||||||
// parse name
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
Q_strncpyz(holoData.name[numProgs], token, sizeof(holoData.name[numProgs]));
|
|
||||||
|
|
||||||
// parse desc1
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
Q_strncpyz(holoData.desc1[numProgs], token, sizeof(holoData.desc1[numProgs]));
|
|
||||||
|
|
||||||
// parse desc2
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
Q_strncpyz(holoData.desc2[numProgs], token, sizeof(holoData.desc2[numProgs]));
|
|
||||||
|
|
||||||
// parse image
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
Q_strncpyz(holoData.image[numProgs], token, sizeof(holoData.image[numProgs]));
|
|
||||||
|
|
||||||
// parse iTrigger
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
Q_strncpyz(holoData.iTrigger[numProgs+1], token, sizeof(holoData.iTrigger[numProgs+1]));
|
|
||||||
|
|
||||||
// parse dTrigger
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
Q_strncpyz(holoData.dTrigger[numProgs+1], token, sizeof(holoData.dTrigger[numProgs+1]));
|
|
||||||
|
|
||||||
holoData.active = -1;
|
|
||||||
|
|
||||||
numProgs++;
|
|
||||||
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for(i = 0; i < MAX_GENTITIES; i++)
|
|
||||||
if(!strcmp("target_holodeck", &g_entities[i]->classname)) {
|
|
||||||
strcpy(holoData.iTrigger[0], &g_entities[i]->target);
|
|
||||||
strcpy(holoData.dTrigger[0], &g_entities[i]->redsound);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
holoData.numProgs = numProgs;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
void G_LoadHolodeckFile(void) {
|
void G_LoadHolodeckFile(void) {
|
||||||
char fileRoute[MAX_QPATH];
|
char fileRoute[MAX_QPATH];
|
||||||
char mapRoute[MAX_QPATH];
|
char mapRoute[MAX_QPATH];
|
||||||
|
@ -1582,107 +1193,9 @@ void G_LoadHolodeckFile(void) {
|
||||||
|
|
||||||
free(buffer);
|
free(buffer);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
srvChangeData_t srvChangeData;
|
srvChangeData_t srvChangeData;
|
||||||
|
|
||||||
#ifdef Q3_VM
|
|
||||||
static void G_LoadServerChangeFile(void) {
|
|
||||||
char fileRoute[MAX_QPATH];
|
|
||||||
//char mapRoute[MAX_QPATH];
|
|
||||||
char infoString[MAX_INFO_STRING];
|
|
||||||
fileHandle_t f;
|
|
||||||
char buffer[20000];
|
|
||||||
int file_len;
|
|
||||||
char *txtPtr, *token;
|
|
||||||
char *temp;
|
|
||||||
int cnt = 0;
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
BG_LanguageFilename("serverchange", "cfg", fileRoute);
|
|
||||||
|
|
||||||
file_len = trap_FS_FOpenFile(fileRoute, &f, FS_READ);
|
|
||||||
|
|
||||||
if(!file_len)
|
|
||||||
return;
|
|
||||||
|
|
||||||
memset(buffer, 0, sizeof(buffer));
|
|
||||||
memset(infoString, 0, sizeof(infoString));
|
|
||||||
|
|
||||||
trap_FS_Read(buffer, file_len, f);
|
|
||||||
if ( !buffer[0] )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: Couldn't read in file: %s!\n", fileRoute );
|
|
||||||
trap_FS_FCloseFile( f );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
buffer[file_len] = '\0';
|
|
||||||
trap_FS_FCloseFile(f);
|
|
||||||
|
|
||||||
COM_BeginParseSession();
|
|
||||||
txtPtr = buffer;
|
|
||||||
|
|
||||||
while(1) {
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
if(!token[0]) break;
|
|
||||||
|
|
||||||
if(!Q_stricmp(token, "ServerChangeConfig")) {
|
|
||||||
token = COM_Parse( &txtPtr );
|
|
||||||
if ( Q_strncmp( token, "{", 1 ) != 0 )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: ServerChangeConfig had no opening brace ( { )!\n" );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
while(Q_strncmp(token, "}", 1)) {
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
if(!token[0]) break;
|
|
||||||
|
|
||||||
if(!Q_stricmp(token, "Server")) {
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
if ( Q_strncmp( token, "[", 1 ) != 0 )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: Server had no opening brace ( [ )!\n" );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
while(Q_strncmp(token, "]", 1)) {
|
|
||||||
if(!token[0]) break;
|
|
||||||
|
|
||||||
if(cnt > 12) break;
|
|
||||||
|
|
||||||
temp = G_NewString(token);
|
|
||||||
|
|
||||||
/*if(!infoString[0])
|
|
||||||
Com_sprintf(infoString, sizeof(infoString), "i%i\\%s\\", cnt, temp);
|
|
||||||
else {
|
|
||||||
if(cnt % 2 == 0)
|
|
||||||
Com_sprintf(infoString, sizeof(infoString), "%si%i\\%s\\", infoString, i, temp);
|
|
||||||
else
|
|
||||||
Com_sprintf(infoString, sizeof(infoString), "%sd%i\\%s\\", infoString, i, temp);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if(cnt % 2 == 0)
|
|
||||||
Q_strncpyz(srvChangeData.ip[i], token, sizeof(srvChangeData.ip[i]));
|
|
||||||
else
|
|
||||||
Q_strncpyz(srvChangeData.name[i], token, sizeof(srvChangeData.name[i]));
|
|
||||||
|
|
||||||
cnt++;
|
|
||||||
if(cnt % 2 == 0)
|
|
||||||
i++;
|
|
||||||
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//trap_SetConfigstring(CS_SERVERCHANGE, infoString);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static void G_LoadServerChangeFile(void) {
|
static void G_LoadServerChangeFile(void) {
|
||||||
char fileRoute[MAX_QPATH];
|
char fileRoute[MAX_QPATH];
|
||||||
//char mapRoute[MAX_QPATH];
|
//char mapRoute[MAX_QPATH];
|
||||||
|
@ -1785,107 +1298,9 @@ static void G_LoadServerChangeFile(void) {
|
||||||
free(buffer);
|
free(buffer);
|
||||||
//trap_SetConfigstring(CS_SERVERCHANGE, infoString);
|
//trap_SetConfigstring(CS_SERVERCHANGE, infoString);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
mapChangeData_t mapChangeData;
|
mapChangeData_t mapChangeData;
|
||||||
|
|
||||||
#ifdef Q3_VM
|
|
||||||
static void G_LoadMapChangeFile(void) {
|
|
||||||
char fileRoute[MAX_QPATH];
|
|
||||||
//char mapRoute[MAX_QPATH];
|
|
||||||
char infoString[MAX_INFO_STRING];
|
|
||||||
fileHandle_t f;
|
|
||||||
char buffer[20000];
|
|
||||||
int file_len;
|
|
||||||
char *txtPtr, *token;
|
|
||||||
char *temp;
|
|
||||||
int cnt = 0;
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
BG_LanguageFilename("mapchange", "cfg", fileRoute);
|
|
||||||
|
|
||||||
file_len = trap_FS_FOpenFile(fileRoute, &f, FS_READ);
|
|
||||||
|
|
||||||
if(!file_len)
|
|
||||||
return;
|
|
||||||
|
|
||||||
memset(buffer, 0, sizeof(buffer));
|
|
||||||
memset(infoString, 0, sizeof(infoString));
|
|
||||||
|
|
||||||
trap_FS_Read(buffer, file_len, f);
|
|
||||||
if ( !buffer[0] )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: Couldn't read in file: %s!\n", fileRoute );
|
|
||||||
trap_FS_FCloseFile( f );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
buffer[file_len] = '\0';
|
|
||||||
trap_FS_FCloseFile(f);
|
|
||||||
|
|
||||||
COM_BeginParseSession();
|
|
||||||
txtPtr = buffer;
|
|
||||||
|
|
||||||
while(1) {
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
if(!token[0]) break;
|
|
||||||
|
|
||||||
if(!Q_stricmp(token, "MapChangeConfig")) {
|
|
||||||
token = COM_Parse( &txtPtr );
|
|
||||||
if ( Q_strncmp( token, "{", 1 ) != 0 )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: MapChangeConfig had no opening brace ( { )!\n" );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
while(Q_strncmp(token, "}", 1)) {
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
if(!token[0]) break;
|
|
||||||
|
|
||||||
if(!Q_stricmp(token, "Map")) {
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
if ( Q_strncmp( token, "[", 1 ) != 0 )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: Server had no opening brace ( [ )!\n" );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
while(Q_strncmp(token, "]", 1)) {
|
|
||||||
if(!token[0]) break;
|
|
||||||
|
|
||||||
if(cnt > 12) break;
|
|
||||||
|
|
||||||
temp = G_NewString(token);
|
|
||||||
|
|
||||||
/*if(!infoString[0])
|
|
||||||
Com_sprintf(infoString, sizeof(infoString), "i%i\\%s\\", cnt, temp);
|
|
||||||
else {
|
|
||||||
if(cnt % 2 == 0)
|
|
||||||
Com_sprintf(infoString, sizeof(infoString), "%si%i\\%s\\", infoString, i, temp);
|
|
||||||
else
|
|
||||||
Com_sprintf(infoString, sizeof(infoString), "%sd%i\\%s\\", infoString, i, temp);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if(cnt % 2 == 0)
|
|
||||||
Q_strncpyz(mapChangeData.name[i], token, sizeof(mapChangeData.name[i]));
|
|
||||||
else
|
|
||||||
Q_strncpyz(mapChangeData.bspname[i], token, sizeof(mapChangeData.bspname[i]));
|
|
||||||
|
|
||||||
cnt++;
|
|
||||||
if(cnt % 2 == 0)
|
|
||||||
i++;
|
|
||||||
|
|
||||||
token = COM_Parse(&txtPtr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//trap_SetConfigstring(CS_SERVERCHANGE, infoString);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static void G_LoadMapChangeFile(void) {
|
static void G_LoadMapChangeFile(void) {
|
||||||
char fileRoute[MAX_QPATH];
|
char fileRoute[MAX_QPATH];
|
||||||
//char mapRoute[MAX_QPATH];
|
//char mapRoute[MAX_QPATH];
|
||||||
|
@ -1988,213 +1403,7 @@ static void G_LoadMapChangeFile(void) {
|
||||||
free(buffer);
|
free(buffer);
|
||||||
//trap_SetConfigstring(CS_SERVERCHANGE, infoString);
|
//trap_SetConfigstring(CS_SERVERCHANGE, infoString);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef Q3_VM
|
|
||||||
static void G_LoadLocationsFile( void )
|
|
||||||
{
|
|
||||||
char fileRoute[MAX_QPATH];
|
|
||||||
char mapRoute[MAX_QPATH];
|
|
||||||
char serverInfo[MAX_TOKEN_CHARS];
|
|
||||||
fileHandle_t f;
|
|
||||||
char buffer[20000];
|
|
||||||
int file_len;
|
|
||||||
char *textPtr, *token;
|
|
||||||
vec3_t origin, angles;
|
|
||||||
gentity_t *ent;
|
|
||||||
char *desc;
|
|
||||||
int rest;
|
|
||||||
|
|
||||||
//get the map name out of the server data
|
|
||||||
trap_GetServerinfo( serverInfo, sizeof( serverInfo ) );
|
|
||||||
|
|
||||||
//setup the file route
|
|
||||||
Com_sprintf( mapRoute, sizeof( mapRoute ), "maps/%s", Info_ValueForKey( serverInfo, "mapname" ) );
|
|
||||||
|
|
||||||
BG_LanguageFilename( mapRoute, "locations", fileRoute );
|
|
||||||
|
|
||||||
file_len = trap_FS_FOpenFile( fileRoute, &f, FS_READ );
|
|
||||||
|
|
||||||
if ( !file_len )
|
|
||||||
return;
|
|
||||||
|
|
||||||
memset( buffer, 0, sizeof(buffer) );
|
|
||||||
|
|
||||||
trap_FS_Read( buffer, file_len, f );
|
|
||||||
if ( !buffer[0] )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: Couldn't read in file: %s!\n", fileRoute );
|
|
||||||
trap_FS_FCloseFile( f );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
buffer[file_len] = '\0';
|
|
||||||
trap_FS_FCloseFile( f );
|
|
||||||
|
|
||||||
G_Printf( "Locations file %s located. Proceeding to load scan data.\n", fileRoute ); //GSIO01: why did this say "Usables file ..."? lol
|
|
||||||
|
|
||||||
COM_BeginParseSession();
|
|
||||||
textPtr = buffer;
|
|
||||||
|
|
||||||
while( 1 )
|
|
||||||
{
|
|
||||||
token = COM_Parse( &textPtr );
|
|
||||||
if ( !token[0] )
|
|
||||||
break;
|
|
||||||
|
|
||||||
if(!Q_strncmp( token, "LocationsList2", 19 )) { // new style locations list with restricted locations
|
|
||||||
token = COM_Parse( &textPtr );
|
|
||||||
if ( Q_strncmp( token, "{", 1 ) != 0 )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: LocationsList2 had no opening brace ( { )!\n", fileRoute );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
//expected format is "<origin> <angle> <int> <string>"
|
|
||||||
while ( Q_strncmp( token, "}", 1 ) )
|
|
||||||
{
|
|
||||||
if ( !token[0] )
|
|
||||||
break;
|
|
||||||
|
|
||||||
//Parse origin
|
|
||||||
if ( COM_ParseVec3( &textPtr, origin ) )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "Invalid origin entry in %s!\n", fileRoute );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Parse angles
|
|
||||||
if ( COM_ParseVec3( &textPtr, angles ) )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "Invalid origin entry in %s!\n", fileRoute );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Pars restriction value
|
|
||||||
if( COM_ParseInt( &textPtr, &rest ) )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "Invalid restriction entry in %s!\n", fileRoute );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Parse Location string
|
|
||||||
token = COM_ParseExt( &textPtr, qfalse );
|
|
||||||
if ( !token[0] )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "Invalid string desc entry in %s!\n", fileRoute );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
desc = token;
|
|
||||||
|
|
||||||
//create a new entity
|
|
||||||
ent = G_Spawn();
|
|
||||||
if ( !ent )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "Couldn't create entity in %s!\n", fileRoute );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ent->classname = "target_location";
|
|
||||||
|
|
||||||
//copy position data
|
|
||||||
VectorCopy( origin, ent->s.origin );
|
|
||||||
VectorCopy( angles, ent->s.angles );
|
|
||||||
|
|
||||||
//copy string
|
|
||||||
ent->message = G_NewString( desc );
|
|
||||||
|
|
||||||
//copy desc into target as well
|
|
||||||
ent->target = ent->targetname = G_NewString( desc );
|
|
||||||
|
|
||||||
// copy restriction value
|
|
||||||
ent->sound1to2 = rest;
|
|
||||||
|
|
||||||
//G_Printf( S_COLOR_RED "Added string %s to entity %i.\n", ent->message, (int)(ent-g_entities) );
|
|
||||||
|
|
||||||
//initiate it as a location ent
|
|
||||||
SP_target_location( ent );
|
|
||||||
|
|
||||||
//reset the ent
|
|
||||||
ent = NULL;
|
|
||||||
|
|
||||||
//--
|
|
||||||
token = COM_Parse( &textPtr );
|
|
||||||
}
|
|
||||||
} else if ( !Q_strncmp( token, "LocationsList", 18 ) ) // old stly locations file
|
|
||||||
{
|
|
||||||
token = COM_Parse( &textPtr );
|
|
||||||
if ( Q_strncmp( token, "{", 1 ) != 0 )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: LocationsList had no opening brace ( { )!\n", fileRoute );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
//expected format is "<origin> <angle> <string>"
|
|
||||||
while ( Q_strncmp( token, "}", 1 ) )
|
|
||||||
{
|
|
||||||
if ( !token[0] )
|
|
||||||
break;
|
|
||||||
|
|
||||||
//Parse origin
|
|
||||||
if ( COM_ParseVec3( &textPtr, origin ) )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "Invalid origin entry in %s!\n", fileRoute );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Parse angles
|
|
||||||
if ( COM_ParseVec3( &textPtr, angles ) )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "Invalid origin entry in %s!\n", fileRoute );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Parse Location string
|
|
||||||
token = COM_ParseExt( &textPtr, qfalse );
|
|
||||||
if ( !token[0] )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "Invalid string desc entry in %s!\n", fileRoute );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
desc = token;
|
|
||||||
|
|
||||||
//create a new entity
|
|
||||||
ent = G_Spawn();
|
|
||||||
if ( !ent )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "Couldn't create entity in %s!\n", fileRoute );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ent->classname = "target_location";
|
|
||||||
|
|
||||||
//copy position data
|
|
||||||
VectorCopy( origin, ent->s.origin );
|
|
||||||
VectorCopy( angles, ent->s.angles );
|
|
||||||
|
|
||||||
//copy string
|
|
||||||
ent->message = G_NewString( desc );
|
|
||||||
|
|
||||||
//copy desc into target as well
|
|
||||||
ent->target = ent->targetname = G_NewString( desc );
|
|
||||||
|
|
||||||
//G_Printf( S_COLOR_RED "Added string %s to entity %i.\n", ent->message, (int)(ent-g_entities) );
|
|
||||||
|
|
||||||
//initiate it as a location ent
|
|
||||||
SP_target_location( ent );
|
|
||||||
|
|
||||||
//reset the ent
|
|
||||||
ent = NULL;
|
|
||||||
|
|
||||||
//--
|
|
||||||
token = COM_Parse( &textPtr );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static void G_LoadLocationsFile( void )
|
static void G_LoadLocationsFile( void )
|
||||||
{
|
{
|
||||||
char fileRoute[MAX_QPATH];
|
char fileRoute[MAX_QPATH];
|
||||||
|
@ -2423,7 +1632,6 @@ static void G_LoadLocationsFile( void )
|
||||||
|
|
||||||
free(buffer);
|
free(buffer);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*void G_initGroupsList(void)
|
/*void G_initGroupsList(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -183,9 +183,8 @@ void SP_target_warp(gentity_t *ent); //RPG-X | GSIO01 | 19/05/2009
|
||||||
void SP_target_deactivate(gentity_t *ent);
|
void SP_target_deactivate(gentity_t *ent);
|
||||||
void SP_target_serverchange(gentity_t *ent);
|
void SP_target_serverchange(gentity_t *ent);
|
||||||
void SP_target_levelchange(gentity_t *ent);
|
void SP_target_levelchange(gentity_t *ent);
|
||||||
#ifdef XTRA
|
/* shader remap */
|
||||||
void SP_target_shaderremap(gentity_t *ent);
|
void SP_target_shaderremap(gentity_t *ent);
|
||||||
#endif
|
|
||||||
|
|
||||||
void SP_light (gentity_t *self);
|
void SP_light (gentity_t *self);
|
||||||
void SP_info_null (gentity_t *self);
|
void SP_info_null (gentity_t *self);
|
||||||
|
@ -388,9 +387,8 @@ spawn_t spawns[] = {
|
||||||
{"target_deactivate", SP_target_deactivate},
|
{"target_deactivate", SP_target_deactivate},
|
||||||
{"target_serverchange", SP_target_serverchange},
|
{"target_serverchange", SP_target_serverchange},
|
||||||
{"target_levelchange", SP_target_levelchange},
|
{"target_levelchange", SP_target_levelchange},
|
||||||
#ifdef XTRA
|
/* shader remap */
|
||||||
{"target_shaderremap", SP_target_shaderremap},
|
{"target_shaderremap", SP_target_shaderremap},
|
||||||
#endif
|
|
||||||
|
|
||||||
{"light", SP_light},
|
{"light", SP_light},
|
||||||
{"path_corner", SP_path_corner},
|
{"path_corner", SP_path_corner},
|
||||||
|
|
369
game/g_target.c
369
game/g_target.c
|
@ -960,10 +960,7 @@ static void target_turbolift_endMove ( gentity_t *ent )
|
||||||
gentity_t* lights=NULL;
|
gentity_t* lights=NULL;
|
||||||
gentity_t* otherLift=NULL;
|
gentity_t* otherLift=NULL;
|
||||||
//gentity_t* tent=NULL;
|
//gentity_t* tent=NULL;
|
||||||
|
|
||||||
#ifdef XTRA
|
|
||||||
float f = 0;
|
float f = 0;
|
||||||
#endif
|
|
||||||
|
|
||||||
otherLift = &g_entities[ent->count];
|
otherLift = &g_entities[ent->count];
|
||||||
if ( !otherLift )
|
if ( !otherLift )
|
||||||
|
@ -1063,8 +1060,7 @@ static void target_turbolift_endMove ( gentity_t *ent )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XTRA
|
/* check for shader remaps */
|
||||||
// check for shader remaps
|
|
||||||
if(rpg_calcLiftTravelDuration.integer) {
|
if(rpg_calcLiftTravelDuration.integer) {
|
||||||
if((ent->truename && otherLift->truename) || (ent->falsename && otherLift->falsename)) {
|
if((ent->truename && otherLift->truename) || (ent->falsename && otherLift->falsename)) {
|
||||||
f = level.time * 0.001;
|
f = level.time * 0.001;
|
||||||
|
@ -1073,7 +1069,6 @@ static void target_turbolift_endMove ( gentity_t *ent )
|
||||||
}
|
}
|
||||||
trap_SetConfigstring(CS_SHADERSTATE, BuildShaderStateConfig());
|
trap_SetConfigstring(CS_SHADERSTATE, BuildShaderStateConfig());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
//next phase, teleport player
|
//next phase, teleport player
|
||||||
ent->nextthink = level.time + ent->sound1to2;
|
ent->nextthink = level.time + ent->sound1to2;
|
||||||
|
@ -1124,65 +1119,6 @@ static void TeleportPlayers ( gentity_t* ent, gentity_t* targetLift, int numEnts
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Q3_VM
|
|
||||||
static void target_turbolift_TeleportPlayers ( gentity_t *ent )
|
|
||||||
{
|
|
||||||
gentity_t *targetLift;
|
|
||||||
vec3_t mins, maxs;
|
|
||||||
float time;
|
|
||||||
|
|
||||||
//store both sets of data so they can be swapped at the same time
|
|
||||||
int liftTouch[MAX_GENTITIES];
|
|
||||||
int targetLiftTouch[MAX_GENTITIES];
|
|
||||||
int liftNumEnts;
|
|
||||||
int targetLiftNumEnts;
|
|
||||||
|
|
||||||
//teleport the players
|
|
||||||
targetLift = &g_entities[ent->count];
|
|
||||||
|
|
||||||
if ( !targetLift ) {
|
|
||||||
target_turbolift_unlock( ent );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//scan the turbo region for players
|
|
||||||
//in the current lift
|
|
||||||
{
|
|
||||||
VectorCopy( ent->r.maxs, maxs );
|
|
||||||
VectorCopy( ent->r.mins, mins );
|
|
||||||
|
|
||||||
liftNumEnts = trap_EntitiesInBox( mins, maxs, liftTouch, MAX_GENTITIES );
|
|
||||||
}
|
|
||||||
|
|
||||||
//the target lift
|
|
||||||
{
|
|
||||||
VectorCopy( targetLift->r.maxs, maxs );
|
|
||||||
VectorCopy( targetLift->r.mins, mins );
|
|
||||||
|
|
||||||
targetLiftNumEnts = trap_EntitiesInBox( mins, maxs, targetLiftTouch, MAX_GENTITIES );
|
|
||||||
}
|
|
||||||
|
|
||||||
//TiM - Teleport the players from the other target to this one
|
|
||||||
TeleportPlayers( targetLift, ent, targetLiftNumEnts, targetLiftTouch );
|
|
||||||
|
|
||||||
//TiM - Teleport the main players
|
|
||||||
TeleportPlayers( ent, targetLift, liftNumEnts, liftTouch );
|
|
||||||
|
|
||||||
if(rpg_calcLiftTravelDuration.integer) {
|
|
||||||
time = targetLift->health - ent->health;
|
|
||||||
if(time < 0)
|
|
||||||
time *= -1;
|
|
||||||
time *= rpg_liftDurationModifier.value;
|
|
||||||
time *= 1000;
|
|
||||||
ent->think = target_turbolift_endMove;
|
|
||||||
ent->nextthink = level.time + (time * 0.5f);
|
|
||||||
} else {
|
|
||||||
//first thing's first
|
|
||||||
ent->think = target_turbolift_endMove;
|
|
||||||
ent->nextthink = level.time + (ent->wait*0.5f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static void target_turbolift_TeleportPlayers ( gentity_t *ent )
|
static void target_turbolift_TeleportPlayers ( gentity_t *ent )
|
||||||
{
|
{
|
||||||
gentity_t *targetLift;
|
gentity_t *targetLift;
|
||||||
|
@ -1266,8 +1202,6 @@ static void target_turbolift_TeleportPlayers ( gentity_t *ent )
|
||||||
free(liftTouch);
|
free(liftTouch);
|
||||||
free(targetLiftTouch);
|
free(targetLiftTouch);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static void target_turbolift_startSoundEnd(gentity_t *ent) {
|
static void target_turbolift_startSoundEnd(gentity_t *ent) {
|
||||||
ent->nextthink = -1;
|
ent->nextthink = -1;
|
||||||
|
@ -1281,10 +1215,7 @@ static void target_turbolift_startMove ( gentity_t *ent )
|
||||||
gentity_t* otherLift=NULL;
|
gentity_t* otherLift=NULL;
|
||||||
gentity_t* tent=NULL;
|
gentity_t* tent=NULL;
|
||||||
float time = 0, time2 = 0;
|
float time = 0, time2 = 0;
|
||||||
|
|
||||||
#ifdef XTRA
|
|
||||||
float f = 0;
|
float f = 0;
|
||||||
#endif
|
|
||||||
|
|
||||||
otherLift = &g_entities[ent->count];
|
otherLift = &g_entities[ent->count];
|
||||||
if ( !otherLift )
|
if ( !otherLift )
|
||||||
|
@ -1399,7 +1330,6 @@ static void target_turbolift_startMove ( gentity_t *ent )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XTRA
|
|
||||||
// check for shader remaps
|
// check for shader remaps
|
||||||
if(rpg_calcLiftTravelDuration.integer) {
|
if(rpg_calcLiftTravelDuration.integer) {
|
||||||
if(time2 < 0 && ent->truename && otherLift->truename) {
|
if(time2 < 0 && ent->truename && otherLift->truename) {
|
||||||
|
@ -1413,7 +1343,6 @@ static void target_turbolift_startMove ( gentity_t *ent )
|
||||||
}
|
}
|
||||||
trap_SetConfigstring(CS_SHADERSTATE, BuildShaderStateConfig());
|
trap_SetConfigstring(CS_SHADERSTATE, BuildShaderStateConfig());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if(rpg_calcLiftTravelDuration.integer) {
|
if(rpg_calcLiftTravelDuration.integer) {
|
||||||
/*time = ent->health - otherLift->health;
|
/*time = ent->health - otherLift->health;
|
||||||
|
@ -1766,295 +1695,6 @@ void SP_target_doorLock(gentity_t *ent) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//RPG-X | GSIO01 | 11/05/2009 | MOD START
|
//RPG-X | GSIO01 | 11/05/2009 | MOD START
|
||||||
#ifndef XTRA
|
|
||||||
/*QUAKED target_alert (1 0 0) (-8 -8 -8) (8 8 8) SOUND_TOGGLE SOUND_OFF
|
|
||||||
This entity acts like 3-Alert-Conditions scripts.
|
|
||||||
|
|
||||||
Any of the func_usables that are used as buttons must have the NO_ACTIVATOR spawnflag.
|
|
||||||
|
|
||||||
SOUND_TOGGLE if set the alert sound can be toggled on/off by using the alerts trigger again.
|
|
||||||
SOUND_OFF if SOUND_TOGGLE is set, the alert will be silent at beginning
|
|
||||||
|
|
||||||
"greenname" the trigger for green alert should target this
|
|
||||||
"yellowname" the trigger for yellow alert should target this
|
|
||||||
"redname" the trigger for red alert should target this
|
|
||||||
"bluename" the trigger for blue alert should target this
|
|
||||||
"greentarget" anything that should be toggled when activating green alert
|
|
||||||
"yellowtarget" anything that should be toggled when activating yellow alert
|
|
||||||
"redtarget" anything that should be toggled when activating red alert
|
|
||||||
"bluetarget" anything that should be toggled when activating blue alert
|
|
||||||
"greensnd" targetname of target_speaker with sound for green alert
|
|
||||||
"yellowsnd" targetname of target_speaker with sound for yellow alert
|
|
||||||
"redsnd" targetname of target_speaker with sound for red alert
|
|
||||||
"bluesnd" targetname of target_speaker with sound for blue alert
|
|
||||||
*/
|
|
||||||
void target_alert_use(gentity_t *ent, gentity_t *other, gentity_t *activator) {
|
|
||||||
if(!Q_stricmp(activator->target, ent->swapname)) {
|
|
||||||
if(ent->damage == 0) {
|
|
||||||
if(ent->spawnflags & 1) {
|
|
||||||
ent->health = !ent->health;
|
|
||||||
ent->target = ent->greensound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
switch(ent->damage) {
|
|
||||||
case 1: // yellow
|
|
||||||
if(ent->health) {
|
|
||||||
ent->target = ent->yellowsound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
ent->health = !ent->health;
|
|
||||||
}
|
|
||||||
/*if(!ent->spawnflags) {
|
|
||||||
ent->target = ent->yellowsound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
}*/
|
|
||||||
ent->target = ent->falsetarget;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
break;
|
|
||||||
case 2: // red
|
|
||||||
if(ent->health) {
|
|
||||||
ent->target = ent->redsound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
ent->health = !ent->health;
|
|
||||||
}
|
|
||||||
/*if(!ent->spawnflags) {
|
|
||||||
ent->target = ent->redsound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
}*/
|
|
||||||
ent->target = ent->paintarget;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
break;
|
|
||||||
case 3: // blue
|
|
||||||
if(ent->health) {
|
|
||||||
ent->target = ent->bluesound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
ent->health = !ent->health;
|
|
||||||
}
|
|
||||||
/*if(!ent->spawnflags) {
|
|
||||||
ent->target = ent->bluesound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
}*/
|
|
||||||
ent->target = ent->targetname2;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if(!ent->spawnflags) {
|
|
||||||
ent->target = ent->greensound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
} else if(ent->spawnflags & 2) {
|
|
||||||
ent->health = 0;
|
|
||||||
} else {
|
|
||||||
if(ent->spawnflags) {
|
|
||||||
ent->target = ent->greensound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
ent->health = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ent->target = ent->truetarget;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
ent->damage = 0;
|
|
||||||
}
|
|
||||||
} else if(!Q_stricmp(activator->target, ent->truename)) {
|
|
||||||
if(ent->damage == 1) {
|
|
||||||
if(ent->spawnflags & 1) {
|
|
||||||
ent->health = !ent->health;
|
|
||||||
ent->target = ent->yellowsound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
switch(ent->damage) {
|
|
||||||
case 0: // green
|
|
||||||
if(ent->health) {
|
|
||||||
ent->target = ent->greensound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
ent->health = !ent->health;
|
|
||||||
}
|
|
||||||
/*if(!ent->spawnflags) {
|
|
||||||
ent->target = ent->greensound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
}*/
|
|
||||||
ent->target = ent->truetarget;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
break;
|
|
||||||
case 2: // red
|
|
||||||
if(ent->health) {
|
|
||||||
ent->target = ent->redsound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
ent->health = !ent->health;
|
|
||||||
}
|
|
||||||
/*if(!ent->spawnflags) {
|
|
||||||
ent->target = ent->redsound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
}*/
|
|
||||||
ent->target = ent->paintarget;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
break;
|
|
||||||
case 3: // blue
|
|
||||||
if(ent->health) {
|
|
||||||
ent->target = ent->bluesound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
ent->health = !ent->health;
|
|
||||||
}
|
|
||||||
/*if(!ent->spawnflags) {
|
|
||||||
ent->target = ent->bluesound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
}*/
|
|
||||||
ent->target = ent->targetname2;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if(!ent->spawnflags) {
|
|
||||||
ent->target = ent->yellowsound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
} else if(ent->spawnflags & 2) {
|
|
||||||
ent->health = 0;
|
|
||||||
} else {
|
|
||||||
if(ent->spawnflags) {
|
|
||||||
ent->target = ent->yellowsound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
ent->health = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ent->target = ent->falsetarget;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
ent->damage = 1;
|
|
||||||
}
|
|
||||||
} else if(!Q_stricmp(activator->target, ent->falsename)) {
|
|
||||||
if(ent->damage == 2) {
|
|
||||||
if(ent->spawnflags & 1) {
|
|
||||||
ent->health = !ent->health;
|
|
||||||
ent->target = ent->redsound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
switch(ent->damage) {
|
|
||||||
case 0: // green
|
|
||||||
if(ent->health) {
|
|
||||||
ent->target = ent->greensound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
ent->health = !ent->health;
|
|
||||||
}
|
|
||||||
/*if(!ent->spawnflags) {
|
|
||||||
ent->target = ent->greensound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
}*/
|
|
||||||
ent->target = ent->truetarget;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
break;
|
|
||||||
case 1: // ryellow
|
|
||||||
if(ent->health) {
|
|
||||||
ent->target = ent->yellowsound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
ent->health = !ent->health;
|
|
||||||
}
|
|
||||||
/*if(!ent->spawnflags) {
|
|
||||||
ent->target = ent->yellowsound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
}*/
|
|
||||||
ent->target = ent->falsetarget;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
break;
|
|
||||||
case 3: // blue
|
|
||||||
if(ent->health) {
|
|
||||||
ent->target = ent->bluesound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
ent->health = !ent->health;
|
|
||||||
}
|
|
||||||
/*if(!ent->spawnflags) {
|
|
||||||
ent->target = ent->bluesound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
}*/
|
|
||||||
ent->target = ent->targetname2;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if(!ent->spawnflags) {
|
|
||||||
ent->target = ent->redsound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
} else if(ent->spawnflags & 2) {
|
|
||||||
ent->health = 0;
|
|
||||||
} else {
|
|
||||||
if(ent->spawnflags) {
|
|
||||||
ent->target = ent->redsound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
ent->health = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ent->target = ent->paintarget;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
ent->damage = 2;
|
|
||||||
}
|
|
||||||
} if(!Q_stricmp(activator->target, ent->bluename)) {
|
|
||||||
if(ent->damage == 3) {
|
|
||||||
if(ent->spawnflags & 1) {
|
|
||||||
ent->health = !ent->health;
|
|
||||||
ent->target = ent->bluesound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
switch(ent->damage) {
|
|
||||||
case 0: // green
|
|
||||||
if(ent->health) {
|
|
||||||
ent->target = ent->greensound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
ent->health = !ent->health;
|
|
||||||
}
|
|
||||||
/*if(!ent->spawnflags) {
|
|
||||||
ent->target = ent->greensound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
}*/
|
|
||||||
ent->target = ent->truetarget;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
break;
|
|
||||||
case 1: // yellow
|
|
||||||
if(ent->health) {
|
|
||||||
ent->target = ent->yellowsound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
ent->health = !ent->health;
|
|
||||||
}
|
|
||||||
/*if(!ent->spawnflags) {
|
|
||||||
ent->target = ent->yellowsound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
}*/
|
|
||||||
ent->target = ent->falsetarget;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
break;
|
|
||||||
case 2: // red
|
|
||||||
if(ent->health) {
|
|
||||||
ent->target = ent->redsound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
ent->health = !ent->health;
|
|
||||||
}
|
|
||||||
/*if(!ent->spawnflags) {
|
|
||||||
ent->target = ent->redsound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
}*/
|
|
||||||
ent->target = ent->paintarget;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if(!ent->spawnflags) {
|
|
||||||
ent->target = ent->bluesound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
} else if(ent->spawnflags & 2) {
|
|
||||||
ent->health = 0;
|
|
||||||
} else {
|
|
||||||
if(ent->spawnflags) {
|
|
||||||
ent->target = ent->bluesound;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
ent->health = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ent->target = ent->targetname2;
|
|
||||||
G_UseTargets(ent, ent);
|
|
||||||
ent->damage = 3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Free activator if no classname <-- alert command
|
|
||||||
if(!activator->classname)
|
|
||||||
G_FreeEntity(activator);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
/*QUAKED target_alert (1 0 0) (-8 -8 -8) (8 8 8) SOUND_TOGGLE SOUND_OFF
|
/*QUAKED target_alert (1 0 0) (-8 -8 -8) (8 8 8) SOUND_TOGGLE SOUND_OFF
|
||||||
This entity acts like 3-Alert-Conditions scripts.
|
This entity acts like 3-Alert-Conditions scripts.
|
||||||
|
|
||||||
|
@ -2411,9 +2051,7 @@ void target_alert_use(gentity_t *ent, gentity_t *other, gentity_t *activator) {
|
||||||
if(!activator->classname)
|
if(!activator->classname)
|
||||||
G_FreeEntity(activator);
|
G_FreeEntity(activator);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef XTRA
|
|
||||||
void target_alert_parseShaders(gentity_t *ent) {
|
void target_alert_parseShaders(gentity_t *ent) {
|
||||||
char buffer[BIG_INFO_STRING];
|
char buffer[BIG_INFO_STRING];
|
||||||
char *txtPtr;
|
char *txtPtr;
|
||||||
|
@ -2495,7 +2133,6 @@ void target_alert_parseShaders(gentity_t *ent) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void SP_target_alert(gentity_t *ent) {
|
void SP_target_alert(gentity_t *ent) {
|
||||||
//int errorNum = 0;
|
//int errorNum = 0;
|
||||||
|
@ -2517,7 +2154,6 @@ void SP_target_alert(gentity_t *ent) {
|
||||||
G_SpawnString("bluetarget", "", &temp);
|
G_SpawnString("bluetarget", "", &temp);
|
||||||
ent->targetname2 = G_NewString(temp);
|
ent->targetname2 = G_NewString(temp);
|
||||||
|
|
||||||
#ifdef XTRA
|
|
||||||
if(G_SpawnString("greenshader", "", &temp))
|
if(G_SpawnString("greenshader", "", &temp))
|
||||||
ent->message = G_NewString(temp);
|
ent->message = G_NewString(temp);
|
||||||
if(G_SpawnString("yellowshader", "", &temp))
|
if(G_SpawnString("yellowshader", "", &temp))
|
||||||
|
@ -2528,7 +2164,6 @@ void SP_target_alert(gentity_t *ent) {
|
||||||
ent->model2 = G_NewString(temp);
|
ent->model2 = G_NewString(temp);
|
||||||
|
|
||||||
target_alert_parseShaders(ent);
|
target_alert_parseShaders(ent);
|
||||||
#endif
|
|
||||||
|
|
||||||
if(!ent->swapname || !ent->truename || !ent->falsename || !ent->bluename ||
|
if(!ent->swapname || !ent->truename || !ent->falsename || !ent->bluename ||
|
||||||
!ent->truetarget || !ent->falsetarget || !ent->paintarget || !ent->targetname2) {
|
!ent->truetarget || !ent->falsetarget || !ent->paintarget || !ent->targetname2) {
|
||||||
|
@ -2878,7 +2513,6 @@ void SP_target_holodeck(gentity_t *ent) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//RPG-X | Harry Young | 15/10/2011 | MOD START
|
//RPG-X | Harry Young | 15/10/2011 | MOD START
|
||||||
#ifdef XTRA
|
|
||||||
/*QUAKED target_shaderremap (1 0 0) (-8 -8 -8) (8 8 8)
|
/*QUAKED target_shaderremap (1 0 0) (-8 -8 -8) (8 8 8)
|
||||||
This will remap the shader "falsename" with shader "truename" and vice versa.
|
This will remap the shader "falsename" with shader "truename" and vice versa.
|
||||||
It will save you some vfx-usables.
|
It will save you some vfx-usables.
|
||||||
|
@ -2922,5 +2556,4 @@ void SP_target_shaderremap(gentity_t *ent) {
|
||||||
|
|
||||||
ent->use = target_shaderremap_use;
|
ent->use = target_shaderremap_use;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
//RPG-X | Harry Young | 15/10/2011 | MOD END
|
//RPG-X | Harry Young | 15/10/2011 | MOD END
|
||||||
|
|
137
game/g_usable.c
137
game/g_usable.c
|
@ -49,14 +49,12 @@ void func_usable_think( gentity_t *self )
|
||||||
|
|
||||||
void func_usable_use (gentity_t *self, gentity_t *other, gentity_t *activator)
|
void func_usable_use (gentity_t *self, gentity_t *other, gentity_t *activator)
|
||||||
{//Toggle on and off
|
{//Toggle on and off
|
||||||
#ifdef XTRA
|
|
||||||
//Remap shader
|
//Remap shader
|
||||||
if(self->targetShaderName && self->targetShaderNewName) {
|
if(self->targetShaderName && self->targetShaderNewName) {
|
||||||
float f = level.time * 0.001;
|
float f = level.time * 0.001;
|
||||||
AddRemap(self->targetShaderName, self->targetShaderNewName, f);
|
AddRemap(self->targetShaderName, self->targetShaderNewName, f);
|
||||||
trap_SetConfigstring(CS_SHADERSTATE, BuildShaderStateConfig());
|
trap_SetConfigstring(CS_SHADERSTATE, BuildShaderStateConfig());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
//RPG-X | GSIO01 | 09/05/2009:
|
//RPG-X | GSIO01 | 09/05/2009:
|
||||||
|
@ -310,139 +308,6 @@ G_LoadMapConfigurations
|
||||||
* \return sucessfully loaded?
|
* \return sucessfully loaded?
|
||||||
* \author Ubergames - TiM
|
* \author Ubergames - TiM
|
||||||
*/
|
*/
|
||||||
#ifdef Q3_VM
|
|
||||||
qboolean G_SetupUsablesStrings( void )
|
|
||||||
{
|
|
||||||
char serverInfo[MAX_TOKEN_CHARS];
|
|
||||||
char fileRoute[MAX_QPATH];
|
|
||||||
char buffer[20000];
|
|
||||||
int file_len;
|
|
||||||
char *textPtr, *token;
|
|
||||||
fileHandle_t f;
|
|
||||||
int i, j;
|
|
||||||
|
|
||||||
level.hasScannableFile = qfalse;
|
|
||||||
level.hasEntScannableFile = qfalse;
|
|
||||||
|
|
||||||
//get the map name out of the server data
|
|
||||||
trap_GetServerinfo( serverInfo, sizeof( serverInfo ) );
|
|
||||||
|
|
||||||
//setup the file route
|
|
||||||
Com_sprintf( fileRoute, sizeof( fileRoute ), "maps/%s.usables", Info_ValueForKey( serverInfo, "mapname" ) );
|
|
||||||
|
|
||||||
file_len = trap_FS_FOpenFile( fileRoute, &f, FS_READ );
|
|
||||||
|
|
||||||
//It's assumed most maps won't have this feature, so just exit 'gracefully'
|
|
||||||
if ( file_len<=1 )
|
|
||||||
{
|
|
||||||
trap_FS_FCloseFile( f );
|
|
||||||
//G_Printf( S_COLOR_YELLOW "WARNING: No file named %s was found.\n", fileRoute );
|
|
||||||
return qfalse;
|
|
||||||
}
|
|
||||||
|
|
||||||
//fill the buffer with the file data
|
|
||||||
memset( &buffer, 0, sizeof( buffer ) );
|
|
||||||
trap_FS_Read( buffer, file_len, f );
|
|
||||||
buffer[file_len] = '0';
|
|
||||||
|
|
||||||
trap_FS_FCloseFile( f );
|
|
||||||
|
|
||||||
if ( !buffer[0] )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: Attempted to load %s, but no data was inside!\n", fileRoute );
|
|
||||||
return qfalse;
|
|
||||||
}
|
|
||||||
|
|
||||||
G_Printf( "Usables file %s located. Proceeding to load scan data.\n", fileRoute );
|
|
||||||
|
|
||||||
COM_BeginParseSession();
|
|
||||||
textPtr = buffer;
|
|
||||||
|
|
||||||
i = 0; //used for the main arrays indices
|
|
||||||
|
|
||||||
while( 1 )
|
|
||||||
{
|
|
||||||
token = COM_Parse( &textPtr );
|
|
||||||
if ( !token[0] )
|
|
||||||
break;
|
|
||||||
|
|
||||||
if ( !Q_strncmp( token, "UsableDescriptions", 18 ) )
|
|
||||||
{
|
|
||||||
token = COM_Parse( &textPtr );
|
|
||||||
if ( Q_strncmp( token, "{", 1 ) != 0 )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: UsableDescriptions had no opening brace ( { )!\n", fileRoute );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
level.hasScannableFile = qtrue;
|
|
||||||
|
|
||||||
token = COM_Parse( &textPtr );
|
|
||||||
|
|
||||||
//expected format is 'id' <space> 'string'
|
|
||||||
while ( Q_strncmp( token, "}", 1 ) )
|
|
||||||
{
|
|
||||||
if ( !token[0] )
|
|
||||||
break;
|
|
||||||
|
|
||||||
if ( !Q_strncmp( token, "UsableEntities", 14 ) )
|
|
||||||
{
|
|
||||||
token = COM_Parse( &textPtr );
|
|
||||||
if ( Q_strncmp( token, "{", 1 ) )
|
|
||||||
{
|
|
||||||
G_Printf( S_COLOR_RED "ERROR: UsableEntities had no opening brace ( { )!\n", fileRoute );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
level.hasEntScannableFile = qtrue;
|
|
||||||
|
|
||||||
token = COM_Parse( &textPtr );
|
|
||||||
|
|
||||||
j = 0;
|
|
||||||
while( Q_strncmp( token, "}", 1 ) )
|
|
||||||
{
|
|
||||||
if ( !token[0] )
|
|
||||||
break;
|
|
||||||
|
|
||||||
if ( token[0] != 'e' )
|
|
||||||
{
|
|
||||||
SkipRestOfLine( &textPtr );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
token++; //skip the 'e'
|
|
||||||
|
|
||||||
level.g_entScannables[j][0] = atoi( token );
|
|
||||||
token = COM_ParseExt( &textPtr, qfalse );
|
|
||||||
level.g_entScannables[j][1] = atoi( token );
|
|
||||||
|
|
||||||
//there's no way clients are scannable in here, so just validate the entry b4 proceeding
|
|
||||||
if ( level.g_entScannables[j][0] > MAX_CLIENTS-1 && level.g_entScannables[j][1] > 0 )
|
|
||||||
j++;
|
|
||||||
|
|
||||||
token = COM_Parse( &textPtr );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
level.g_scannables[i] = atoi( token );
|
|
||||||
|
|
||||||
//ensure a valid number was passed, else ignore it
|
|
||||||
if ( level.g_scannables[i] > 0 )
|
|
||||||
i++;
|
|
||||||
|
|
||||||
//we don't need the text on the server side
|
|
||||||
SkipRestOfLine( &textPtr );
|
|
||||||
|
|
||||||
token = COM_Parse( &textPtr );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return qtrue;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
qboolean G_SetupUsablesStrings( void )
|
qboolean G_SetupUsablesStrings( void )
|
||||||
{
|
{
|
||||||
char *serverInfo;
|
char *serverInfo;
|
||||||
|
@ -588,5 +453,5 @@ qboolean G_SetupUsablesStrings( void )
|
||||||
free(buffer);
|
free(buffer);
|
||||||
return qtrue;
|
return qtrue;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
#include "g_local.h"
|
#include "g_local.h"
|
||||||
|
|
||||||
#ifdef XTRA
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char oldShader[MAX_QPATH];
|
char oldShader[MAX_QPATH];
|
||||||
char newShader[MAX_QPATH];
|
char newShader[MAX_QPATH];
|
||||||
|
@ -47,7 +46,6 @@ const char *BuildShaderStateConfig(void) {
|
||||||
}
|
}
|
||||||
return buff;
|
return buff;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=========================================================================
|
=========================================================================
|
||||||
|
@ -336,13 +334,11 @@ void G_UseTargets2( gentity_t *ent, gentity_t *activator, char *target ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XTRA
|
|
||||||
if (ent->targetShaderName && ent->targetShaderNewName) {
|
if (ent->targetShaderName && ent->targetShaderNewName) {
|
||||||
float f = level.time * 0.001;
|
float f = level.time * 0.001;
|
||||||
AddRemap(ent->targetShaderName, ent->targetShaderNewName, f);
|
AddRemap(ent->targetShaderName, ent->targetShaderNewName, f);
|
||||||
trap_SetConfigstring(CS_SHADERSTATE, BuildShaderStateConfig());
|
trap_SetConfigstring(CS_SHADERSTATE, BuildShaderStateConfig());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if ( !target ) {
|
if ( !target ) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -905,26 +905,6 @@ char *Q_CleanStr( char *string ) {
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Q3_VM
|
|
||||||
void QDECL Com_sprintf( char *dest, int size, const char *fmt, ...) {
|
|
||||||
int len;
|
|
||||||
va_list argptr;
|
|
||||||
char bigbuffer[32000]; /* big, but small enough to fit in PPC stack */
|
|
||||||
|
|
||||||
va_start (argptr,fmt);
|
|
||||||
len = vsprintf (bigbuffer,fmt,argptr);
|
|
||||||
va_end (argptr);
|
|
||||||
if ( len >= sizeof( bigbuffer ) ) {
|
|
||||||
Com_Error( ERR_FATAL, "Com_sprintf: overflowed bigbuffer" );
|
|
||||||
}
|
|
||||||
if (len >= size) {
|
|
||||||
Com_Printf ("Com_sprintf: overflow of %i in %i\n", len, size);
|
|
||||||
Com_Printf("Fmt: %s\n", fmt);
|
|
||||||
Com_Printf("BigBuffer: %s\n", bigbuffer);
|
|
||||||
}
|
|
||||||
Q_strncpyz (dest, bigbuffer, size );
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
void QDECL Com_sprintf( char *dest, int size, const char *fmt, ...) {
|
void QDECL Com_sprintf( char *dest, int size, const char *fmt, ...) {
|
||||||
int len;
|
int len;
|
||||||
va_list argptr;
|
va_list argptr;
|
||||||
|
@ -953,7 +933,6 @@ void QDECL Com_sprintf( char *dest, int size, const char *fmt, ...) {
|
||||||
}
|
}
|
||||||
Q_strncpyz (dest, bigbuffer, size );
|
Q_strncpyz (dest, bigbuffer, size );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
============
|
============
|
||||||
|
|
|
@ -53,16 +53,13 @@
|
||||||
|
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
// use this to specify whether the code is compile for rpgxEF or not
|
|
||||||
#define XTRA 1
|
|
||||||
// meh somehow preprocessor G_LUA won't work for me
|
// meh somehow preprocessor G_LUA won't work for me
|
||||||
#define G_LUA 1
|
#define G_LUA 1
|
||||||
#define CG_LUA 1
|
#define CG_LUA 1
|
||||||
|
|
||||||
#ifdef Q3_VM
|
#ifdef Q3_VM
|
||||||
|
//#include "bg_lib.h"
|
||||||
#include "bg_lib.h"
|
#error "Q3_VM detected: QVMs are no longer supported by RPG-X2
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -85,7 +82,8 @@
|
||||||
|
|
||||||
// Needed for mods compiled in 64 bit shared objects.
|
// Needed for mods compiled in 64 bit shared objects.
|
||||||
#ifdef Q3_VM
|
#ifdef Q3_VM
|
||||||
typedef int intptr_t;
|
// typedef int intptr_t;
|
||||||
|
#error "Q3_VM detected: QVMs are no longer supported by RPG-X2
|
||||||
#else
|
#else
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
@ -906,13 +904,7 @@ typedef enum {
|
||||||
//
|
//
|
||||||
#define MAX_CLIENTS 128 // absolute limit
|
#define MAX_CLIENTS 128 // absolute limit
|
||||||
#define MAX_LOCATIONS 64
|
#define MAX_LOCATIONS 64
|
||||||
|
#define GENTITYNUM_BITS 11
|
||||||
#ifndef XTRA
|
|
||||||
#define GENTITYNUM_BITS 10 // don't need to send any more
|
|
||||||
#else
|
|
||||||
#define GENTITYNUM_BITS 11 // XTRA
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MAX_GENTITIES (1<<GENTITYNUM_BITS)
|
#define MAX_GENTITIES (1<<GENTITYNUM_BITS)
|
||||||
|
|
||||||
// entitynums are communicated with GENTITY_BITS, so any reserved
|
// entitynums are communicated with GENTITY_BITS, so any reserved
|
||||||
|
@ -922,12 +914,7 @@ typedef enum {
|
||||||
#define ENTITYNUM_WORLD (MAX_GENTITIES-2)
|
#define ENTITYNUM_WORLD (MAX_GENTITIES-2)
|
||||||
#define ENTITYNUM_MAX_NORMAL (MAX_GENTITIES-2)
|
#define ENTITYNUM_MAX_NORMAL (MAX_GENTITIES-2)
|
||||||
|
|
||||||
#ifndef XTRA
|
#define MAX_MODELS_BITS 9
|
||||||
#define MAX_MODELS_BITS 8
|
|
||||||
#else
|
|
||||||
#define MAX_MODELS_BITS 9 // XTRA
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MAX_MODELS (1<<MAX_MODELS_BITS) // these are sent over the net as 8 bits <--- who cares xD
|
#define MAX_MODELS (1<<MAX_MODELS_BITS) // these are sent over the net as 8 bits <--- who cares xD
|
||||||
#define MAX_SOUNDS 256 // so they cannot be blindly increased
|
#define MAX_SOUNDS 256 // so they cannot be blindly increased
|
||||||
|
|
||||||
|
@ -935,11 +922,7 @@ typedef enum {
|
||||||
#define MAX_TRIC_STRINGS 64
|
#define MAX_TRIC_STRINGS 64
|
||||||
#define MAX_DECOYS 64 //128
|
#define MAX_DECOYS 64 //128
|
||||||
|
|
||||||
#ifndef XTRA
|
|
||||||
#define MAX_CONFIGSTRINGS 1024
|
|
||||||
#else
|
|
||||||
#define MAX_CONFIGSTRINGS 4096
|
#define MAX_CONFIGSTRINGS 4096
|
||||||
#endif
|
|
||||||
|
|
||||||
// these are the only configstrings that the system reserves, all the
|
// these are the only configstrings that the system reserves, all the
|
||||||
// other ones are strictly for servergame to clientgame communication
|
// other ones are strictly for servergame to clientgame communication
|
||||||
|
@ -948,12 +931,7 @@ typedef enum {
|
||||||
|
|
||||||
#define RESERVED_CONFIGSTRINGS 2 // game can't modify below this, only the system can
|
#define RESERVED_CONFIGSTRINGS 2 // game can't modify below this, only the system can
|
||||||
|
|
||||||
#ifndef XTRA
|
|
||||||
#define MAX_GAMESTATE_CHARS 16000
|
|
||||||
#else
|
|
||||||
#define MAX_GAMESTATE_CHARS 64000
|
#define MAX_GAMESTATE_CHARS 64000
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int stringOffsets[MAX_CONFIGSTRINGS];
|
int stringOffsets[MAX_CONFIGSTRINGS];
|
||||||
|
|
|
@ -1314,12 +1314,11 @@ qboolean UI_ConsoleCommand( void ) {
|
||||||
return qtrue;
|
return qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XTRA
|
/* TODO remove me? */
|
||||||
if ( Q_stricmp( cmd, "sqlkey" ) == 0) {
|
if ( Q_stricmp( cmd, "sqlkey" ) == 0) {
|
||||||
//UI_LoginSetSqlkey((int)UI_Argv(1));
|
//UI_LoginSetSqlkey((int)UI_Argv(1));
|
||||||
return qtrue;
|
return qtrue;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
return qfalse;
|
return qfalse;
|
||||||
|
|
|
@ -1859,9 +1859,7 @@ extern void TransDataReceived(const char *data);
|
||||||
//
|
//
|
||||||
// ui_login.c
|
// ui_login.c
|
||||||
//
|
//
|
||||||
#ifdef XTRA
|
|
||||||
extern void UI_LoginSetSqlkey(int key);
|
extern void UI_LoginSetSqlkey(int key);
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// ui_demo2.c
|
// ui_demo2.c
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
#include "ui_local.h"
|
#include "ui_local.h"
|
||||||
|
|
||||||
#ifdef XTRA
|
/* TODO remove me? */
|
||||||
|
|
||||||
static byte sqlkey;
|
static byte sqlkey;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -138,4 +137,3 @@ void UI_LoginMenu(void) {
|
||||||
Menu_AdjustCursor(&s_login.menu, 1);
|
Menu_AdjustCursor(&s_login.menu, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //XTRA
|
|
||||||
|
|
Loading…
Reference in a new issue