From c8f750721c31603b0f4cef2d605de45f3032e6d3 Mon Sep 17 00:00:00 2001 From: Walter Julius Hennecke Date: Sat, 5 May 2012 14:13:02 +0200 Subject: [PATCH] Updated README.txt --- README.txt | 23 +- cgame/cg_consolecmds.c | 11 +- cgame/cg_local.h | 3 +- cgame/cg_main.c | 3 +- cgame/cg_public.h | 6 - cgame/cg_servercmds.c | 13 +- cgame/cg_syscalls.c | 4 +- cgame/tr_types.h | 4 - game/bg_public.h | 5 +- game/g_client.c | 108 +----- game/g_local.h | 12 +- game/g_main.c | 796 +---------------------------------------- game/g_spawn.c | 6 +- game/g_target.c | 369 +------------------ game/g_usable.c | 137 +------ game/g_utils.c | 4 - game/q_shared.c | 21 -- game/q_shared.h | 34 +- ui/ui_atoms.c | 3 +- ui/ui_local.h | 2 - ui/ui_login.c | 4 +- 21 files changed, 51 insertions(+), 1517 deletions(-) diff --git a/README.txt b/README.txt index cb4a614..5886d97 100644 --- a/README.txt +++ b/README.txt @@ -28,6 +28,12 @@ On Windows: - make clean removes all compiled files (including the shared libraries) +Cross Compiling for Windows: +Not yet but hopefully soon. + +Mac OSX: +Not yet but hopefully soon. + Bug Reports and Patch/Feature Suggestions: -------------- 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 there (please upload a *.diff file). +Note: +As the UberGames bug tracker is down right now use +http://bugs.hennecke-online.net instead. + Contact: -------------- @@ -44,8 +54,11 @@ Come join our forum at http://forums.ubergames.net/ Legal Notice: ------------- -All assets used in this file are copyrighted to the RPG-X Mod and/or their -original creators. Any external use of these assets without explicit permission -from their original creators is not allowed. -The RPG-X Mod and its creators cannot be held accountable for any damage that -may have been caused by playing the game. +All assets used in this file and/or git repository are copyrighted +to the UberGames and/or their original creators. Any external +use of these assets without explicit permission from their original +creators is not allowed. Feel free to use the source code included +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. diff --git a/cgame/cg_consolecmds.c b/cgame/cg_consolecmds.c index ce10765..c2d7875 100644 --- a/cgame/cg_consolecmds.c +++ b/cgame/cg_consolecmds.c @@ -954,19 +954,24 @@ void CG_InitConsoleCommands( void ) { /* temp */ 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("userAdd"); trap_AddCommand("sql_setup"); trap_AddCommand("userMod"); trap_AddCommand("userDel"); - #endif + /* lua */ #ifdef CG_LUA trap_AddCommand("lua_status"); #endif - /* CCAM */ + /* Cinematic Cam testing */ trap_AddCommand("camtest"); trap_AddCommand("camtestend"); } diff --git a/cgame/cg_local.h b/cgame/cg_local.h index ea28fa6..b58e930 100644 --- a/cgame/cg_local.h +++ b/cgame/cg_local.h @@ -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 void CG_ResetThirdPersonViewDamp ( void ); -#ifdef XTRA +/* shader remapping */ void trap_R_RemapShader( const char *oldShader, const char *newShader, const char *timeOffset ); void CG_ShaderStateChanged(void); -#endif diff --git a/cgame/cg_main.c b/cgame/cg_main.c index 2a780c4..2794963 100644 --- a/cgame/cg_main.c +++ b/cgame/cg_main.c @@ -1826,9 +1826,8 @@ void CG_Init( int serverMessageNum, int serverCommandSequence ) { //TiM2 - Separated this out so class data has to be locally accessed now //CG_ParseClassData(); - #ifdef XTRA + /* shader remapping */ CG_ShaderStateChanged(); - #endif if(grp_berp.integer) CG_Printf(S_COLOR_YELLOW "GSIO01 and Ubergames greet Brave Explorers.\n"); diff --git a/cgame/cg_public.h b/cgame/cg_public.h index 2c8a8df..ca5ba8c 100644 --- a/cgame/cg_public.h +++ b/cgame/cg_public.h @@ -7,9 +7,6 @@ // -// rpgxEF? -#define XTRA 1 - #define CMD_BACKUP 64 #define CMD_MASK (CMD_BACKUP - 1) // allow a lot of command backups for very fast systems @@ -126,10 +123,7 @@ typedef enum { CG_CEIL, CG_TESTPRINTINT, CG_TESTPRINTFLOAT, - -#ifdef XTRA CG_R_REMAP_SHADER = 200, -#endif } cgameImport_t; //these must match up with cg_syscalls.asm diff --git a/cgame/cg_servercmds.c b/cgame/cg_servercmds.c index 89ab5e7..1178635 100644 --- a/cgame/cg_servercmds.c +++ b/cgame/cg_servercmds.c @@ -340,12 +340,9 @@ static void CG_ConfigStringModified( void ) { cgs.redflag = str[0] - '0'; cgs.blueflag = str[1] - '0'; } - #ifdef XTRA else if(num == CS_SHADERSTATE) { CG_ShaderStateChanged(); - } - #endif - + } } @@ -618,7 +615,6 @@ char *ConcatArgs2( int start ) { return line; } -#ifdef XTRA /* ===================== CG_ShaderStateChanged @@ -661,7 +657,6 @@ void CG_ShaderStateChanged(void) { } } } -#endif /* @@ -866,7 +861,7 @@ static void CG_ServerCommand( void ) { return; } - #ifdef XTRA + /* shader remap */ if ( Q_stricmp (cmd, "remapShader") == 0 ) { if (trap_Argc() == 4) @@ -884,7 +879,6 @@ static void CG_ServerCommand( void ) { return; } - #endif if(!strcmp(cmd, "ui_transporter")) { trap_SendConsoleCommand(va("ui_transporter %s", CG_Argv(1))); @@ -906,12 +900,11 @@ static void CG_ServerCommand( void ) { return; } - #ifdef XTRA + /* TODO remove me? */ if(!strcmp(cmd, "sqlkey")) { trap_SendClientCommand(va("sqlkey %i", CG_Argv(1))); return; } - #endif CG_Printf( "Unknown client game command: %s\n", cmd ); } diff --git a/cgame/cg_syscalls.c b/cgame/cg_syscalls.c index 4174214..7bc4ddc 100644 --- a/cgame/cg_syscalls.c +++ b/cgame/cg_syscalls.c @@ -286,8 +286,8 @@ int trap_MemoryRemaining( void ) { return syscall( CG_MEMORY_REMAINING ); } -#ifdef XTRA +/* shader remap */ void trap_R_RemapShader( const char *oldShader, const char *newShader, const char *timeOffset ) { syscall( CG_R_REMAP_SHADER, oldShader, newShader, timeOffset ); } -#endif + diff --git a/cgame/tr_types.h b/cgame/tr_types.h index 684842e..212dd48 100644 --- a/cgame/tr_types.h +++ b/cgame/tr_types.h @@ -6,11 +6,7 @@ #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 -#endif #define MAX_ENTITIES ((1< 16) - { - skin_count_check = 16; - } - - // now construct an array of the names already used - for (i=0; iinuse || 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; iclient->sqlkey = (byte)key; trap_SendServerCommand(ent-g_entities, va("sqlkey \"%i\"", key)); } - #endif } // WEAPONS - PHENIX1 diff --git a/game/g_local.h b/game/g_local.h index fae9fc5..c938bd1 100644 --- a/game/g_local.h +++ b/game/g_local.h @@ -361,10 +361,8 @@ struct gentity_s { //*core, // -->falsetarget //*coreSwap; // -->bluename - #ifdef XTRA char *targetShaderName; //!< shader to remap for shader remapping char *targetShaderNewName; //!< shader to remap to for shader remapping - #endif qboolean tmpEntity; //!< is this a temporal entity? #ifdef G_LUA @@ -602,12 +600,10 @@ struct gclient_s { qboolean *universalTrans;*/ languageData_t *languages; - #ifdef XTRA // for sql char *userName; //!< username (not player name) 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 - #endif // CCAM 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_GetEntityByBmodel(char *bmodel, gentity_t *entities[MAX_GENTITIES]); -#ifdef XTRA +/* shader remapping */ void AddRemap(const char *oldShader, const char *newShader, float timeOffset); -#endif // // g_combat.c @@ -1546,7 +1541,7 @@ extern vmCvar_t rpg_server6; // SP level change extern vmCvar_t rpg_allowSPLevelChange; -#ifdef XTRA +/* TODO some can be removed */ extern vmCvar_t sql_dbName; extern vmCvar_t sql_use; extern vmCvar_t sql_server; @@ -1554,7 +1549,6 @@ extern vmCvar_t sql_user; extern vmCvar_t sql_password; extern vmCvar_t sql_port; extern vmCvar_t sql_hash; -#endif // developer tools extern vmCvar_t dev_showTriggers; @@ -2036,12 +2030,10 @@ struct srvChangeData_s { char bspname[16][MAX_QPATH]; }; -#ifdef XTRA /** * Builds the config string for shader remapping. */ const char *BuildShaderStateConfig(void); -#endif typedef struct luaAlertState_s luaAlertState_t; struct luaAlertState_s { diff --git a/game/g_main.c b/game/g_main.c index fea7cff..7b9e61b 100644 --- a/game/g_main.c +++ b/game/g_main.c @@ -338,7 +338,7 @@ vmCvar_t rpg_server6; //! Allow target_levelchange to change the current level? vmCvar_t rpg_allowSPLevelChange; -#ifdef XTRA +/* TODO some can be removed */ vmCvar_t sql_dbName; //!< Name of the SQL Database vmCvar_t sql_use; //!< Use SQL? 1 = mysql, 2 = sqlite 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 } -#ifdef XTRA +/* TODO some can be removed */ , { &sql_dbName, "sql_dbName", "rpgx", 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 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 ) { char *buffer; @@ -1326,137 +1062,12 @@ static qboolean G_LoadClassData( char* fileName ) return qfalse; } } -#endif void BG_LanguageFilename(char *baseName,char *baseExtension,char *finalName); void SP_target_location (gentity_t *ent); 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: - // - target notnull - // - name - // - desc1 - // - desc2 - // - image - // - iTrigger - // - 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) { char fileRoute[MAX_QPATH]; char mapRoute[MAX_QPATH]; @@ -1582,107 +1193,9 @@ void G_LoadHolodeckFile(void) { free(buffer); } -#endif 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) { char fileRoute[MAX_QPATH]; //char mapRoute[MAX_QPATH]; @@ -1785,107 +1298,9 @@ static void G_LoadServerChangeFile(void) { free(buffer); //trap_SetConfigstring(CS_SERVERCHANGE, infoString); } -#endif 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) { char fileRoute[MAX_QPATH]; //char mapRoute[MAX_QPATH]; @@ -1988,213 +1403,7 @@ static void G_LoadMapChangeFile(void) { free(buffer); //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 " " - 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 " " - 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 ) { char fileRoute[MAX_QPATH]; @@ -2423,7 +1632,6 @@ static void G_LoadLocationsFile( void ) free(buffer); } -#endif /*void G_initGroupsList(void) { diff --git a/game/g_spawn.c b/game/g_spawn.c index 591f793..6c80b6a 100644 --- a/game/g_spawn.c +++ b/game/g_spawn.c @@ -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_serverchange(gentity_t *ent); void SP_target_levelchange(gentity_t *ent); -#ifdef XTRA +/* shader remap */ void SP_target_shaderremap(gentity_t *ent); -#endif void SP_light (gentity_t *self); void SP_info_null (gentity_t *self); @@ -388,9 +387,8 @@ spawn_t spawns[] = { {"target_deactivate", SP_target_deactivate}, {"target_serverchange", SP_target_serverchange}, {"target_levelchange", SP_target_levelchange}, - #ifdef XTRA + /* shader remap */ {"target_shaderremap", SP_target_shaderremap}, - #endif {"light", SP_light}, {"path_corner", SP_path_corner}, diff --git a/game/g_target.c b/game/g_target.c index 87702c0..a7ac426 100644 --- a/game/g_target.c +++ b/game/g_target.c @@ -960,10 +960,7 @@ static void target_turbolift_endMove ( gentity_t *ent ) gentity_t* lights=NULL; gentity_t* otherLift=NULL; //gentity_t* tent=NULL; - - #ifdef XTRA float f = 0; - #endif otherLift = &g_entities[ent->count]; 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((ent->truename && otherLift->truename) || (ent->falsename && otherLift->falsename)) { f = level.time * 0.001; @@ -1073,7 +1069,6 @@ static void target_turbolift_endMove ( gentity_t *ent ) } trap_SetConfigstring(CS_SHADERSTATE, BuildShaderStateConfig()); } - #endif //next phase, teleport player 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 ) { gentity_t *targetLift; @@ -1266,8 +1202,6 @@ static void target_turbolift_TeleportPlayers ( gentity_t *ent ) free(liftTouch); free(targetLiftTouch); } -#endif - static void target_turbolift_startSoundEnd(gentity_t *ent) { ent->nextthink = -1; @@ -1281,10 +1215,7 @@ static void target_turbolift_startMove ( gentity_t *ent ) gentity_t* otherLift=NULL; gentity_t* tent=NULL; float time = 0, time2 = 0; - - #ifdef XTRA float f = 0; - #endif otherLift = &g_entities[ent->count]; if ( !otherLift ) @@ -1399,7 +1330,6 @@ static void target_turbolift_startMove ( gentity_t *ent ) } } - #ifdef XTRA // check for shader remaps if(rpg_calcLiftTravelDuration.integer) { if(time2 < 0 && ent->truename && otherLift->truename) { @@ -1413,7 +1343,6 @@ static void target_turbolift_startMove ( gentity_t *ent ) } trap_SetConfigstring(CS_SHADERSTATE, BuildShaderStateConfig()); } - #endif if(rpg_calcLiftTravelDuration.integer) { /*time = ent->health - otherLift->health; @@ -1766,295 +1695,6 @@ void SP_target_doorLock(gentity_t *ent) { } //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 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) G_FreeEntity(activator); } -#endif -#ifdef XTRA void target_alert_parseShaders(gentity_t *ent) { char buffer[BIG_INFO_STRING]; char *txtPtr; @@ -2495,7 +2133,6 @@ void target_alert_parseShaders(gentity_t *ent) { } } } -#endif void SP_target_alert(gentity_t *ent) { //int errorNum = 0; @@ -2517,7 +2154,6 @@ void SP_target_alert(gentity_t *ent) { G_SpawnString("bluetarget", "", &temp); ent->targetname2 = G_NewString(temp); - #ifdef XTRA if(G_SpawnString("greenshader", "", &temp)) ent->message = G_NewString(temp); if(G_SpawnString("yellowshader", "", &temp)) @@ -2528,7 +2164,6 @@ void SP_target_alert(gentity_t *ent) { ent->model2 = G_NewString(temp); target_alert_parseShaders(ent); - #endif if(!ent->swapname || !ent->truename || !ent->falsename || !ent->bluename || !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 -#ifdef XTRA /*QUAKED target_shaderremap (1 0 0) (-8 -8 -8) (8 8 8) This will remap the shader "falsename" with shader "truename" and vice versa. It will save you some vfx-usables. @@ -2922,5 +2556,4 @@ void SP_target_shaderremap(gentity_t *ent) { ent->use = target_shaderremap_use; } -#endif //RPG-X | Harry Young | 15/10/2011 | MOD END diff --git a/game/g_usable.c b/game/g_usable.c index 94f15bf..622bf37 100644 --- a/game/g_usable.c +++ b/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) {//Toggle on and off - #ifdef XTRA //Remap shader if(self->targetShaderName && self->targetShaderNewName) { float f = level.time * 0.001; AddRemap(self->targetShaderName, self->targetShaderNewName, f); trap_SetConfigstring(CS_SHADERSTATE, BuildShaderStateConfig()); } - #endif //RPG-X | GSIO01 | 09/05/2009: @@ -310,139 +308,6 @@ G_LoadMapConfigurations * \return sucessfully loaded? * \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' '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 ) { char *serverInfo; @@ -588,5 +453,5 @@ qboolean G_SetupUsablesStrings( void ) free(buffer); return qtrue; } -#endif + diff --git a/game/g_utils.c b/game/g_utils.c index 9ceac2e..ed0ac0a 100644 --- a/game/g_utils.c +++ b/game/g_utils.c @@ -4,7 +4,6 @@ #include "g_local.h" -#ifdef XTRA typedef struct { char oldShader[MAX_QPATH]; char newShader[MAX_QPATH]; @@ -47,7 +46,6 @@ const char *BuildShaderStateConfig(void) { } return buff; } -#endif /* ========================================================================= @@ -336,13 +334,11 @@ void G_UseTargets2( gentity_t *ent, gentity_t *activator, char *target ) { return; } - #ifdef XTRA if (ent->targetShaderName && ent->targetShaderNewName) { float f = level.time * 0.001; AddRemap(ent->targetShaderName, ent->targetShaderNewName, f); trap_SetConfigstring(CS_SHADERSTATE, BuildShaderStateConfig()); } - #endif if ( !target ) { return; diff --git a/game/q_shared.c b/game/q_shared.c index 0a31633..fed9314 100644 --- a/game/q_shared.c +++ b/game/q_shared.c @@ -905,26 +905,6 @@ char *Q_CleanStr( char *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, ...) { int len; va_list argptr; @@ -953,7 +933,6 @@ void QDECL Com_sprintf( char *dest, int size, const char *fmt, ...) { } Q_strncpyz (dest, bigbuffer, size ); } -#endif /* ============ diff --git a/game/q_shared.h b/game/q_shared.h index 0f64215..1bae956 100644 --- a/game/q_shared.h +++ b/game/q_shared.h @@ -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 #define G_LUA 1 #define CG_LUA 1 #ifdef Q3_VM - -#include "bg_lib.h" - +//#include "bg_lib.h" +#error "Q3_VM detected: QVMs are no longer supported by RPG-X2 #else #include @@ -85,7 +82,8 @@ // Needed for mods compiled in 64 bit shared objects. #ifdef Q3_VM - typedef int intptr_t; +// typedef int intptr_t; +#error "Q3_VM detected: QVMs are no longer supported by RPG-X2 #else #ifdef _MSC_VER #include @@ -906,13 +904,7 @@ typedef enum { // #define MAX_CLIENTS 128 // absolute limit #define MAX_LOCATIONS 64 - -#ifndef XTRA -#define GENTITYNUM_BITS 10 // don't need to send any more -#else -#define GENTITYNUM_BITS 11 // XTRA -#endif - +#define GENTITYNUM_BITS 11 #define MAX_GENTITIES (1<