mirror of https://github.com/UberGames/rpgxEF.git
fixes
This commit is contained in:
parent
f053e25e16
commit
696a1ad99d
|
@ -3,6 +3,7 @@
|
|||
* bg_misc.c -- both games misc functions, all completely stateless
|
||||
*/
|
||||
|
||||
#include "bg_misc.h"
|
||||
#include "q_shared.h"
|
||||
#include "bg_public.h"
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
#ifndef _BG_MISC_H
|
||||
#define _BG_MISC_H
|
||||
|
||||
void BG_LanguageFilename(char *baseName,char *baseExtension,char *finalName);
|
||||
|
||||
#endif /* _BG_MISC_H */
|
|
@ -954,8 +954,8 @@ void G_Client_UserinfoChanged( int clientNum ) {
|
|||
qboolean changeName = qtrue; //TiM : For the name filter
|
||||
char sHeight[10];
|
||||
char sWeight[10];
|
||||
clientPersistant_t *pers;
|
||||
clientSession_t *sess;
|
||||
clientPersistant_t* pers = NULL;
|
||||
clientSession_t* sess = NULL;
|
||||
|
||||
model[0] = 0;
|
||||
|
||||
|
@ -1006,7 +1006,7 @@ void G_Client_UserinfoChanged( int clientNum ) {
|
|||
Q_CleanStr( activeName );
|
||||
|
||||
if ( g_entities[i].client->ps.clientNum != client->ps.clientNum
|
||||
&& !Q_stricmp( newName, activeName ) )
|
||||
&& Q_stricmp( newName, activeName ) == 0 )
|
||||
{
|
||||
trap_SendServerCommand( ent-g_entities, " print \"Unable to change name. A player already has that name on this server.\n\" ");
|
||||
changeName = qfalse;
|
||||
|
@ -1036,8 +1036,9 @@ void G_Client_UserinfoChanged( int clientNum ) {
|
|||
}
|
||||
|
||||
pers->pms_height = atof( Info_ValueForKey( userinfo, "height" ) );
|
||||
if ( !pers->pms_height )
|
||||
if ( pers->pms_height == 0 ) {
|
||||
pers->pms_height = 1.0f;
|
||||
}
|
||||
|
||||
pers->maxHealth = atoi( Info_ValueForKey( userinfo, "handicap" ) );
|
||||
if ( pers->maxHealth < 1 || pers->maxHealth > 100 ) {
|
||||
|
|
|
@ -725,9 +725,9 @@ typedef struct {
|
|||
|
||||
int numBrushEnts; /*!< number of entities in the level that use brushmodels */
|
||||
|
||||
/*@null@*/ list_p safezones; /*!< self destruct safezones list */
|
||||
/*@null@*/ list_p locations; /*!< level locations list */
|
||||
/*@null@*/ list_p timedMessages; /*!< timed messages list */
|
||||
/*@shared@*/ /*@null@*/ list_p safezones; /*!< self destruct safezones list */
|
||||
/*@shared@*/ /*@null@*/ list_p locations; /*!< level locations list */
|
||||
/*@shared@*/ /*@null@*/ list_p timedMessages; /*!< timed messages list */
|
||||
|
||||
// other stuff
|
||||
srvChangeData_t srvChangeData; /*!< Server change data */
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include "g_groups.h"
|
||||
#include "bg_lex.h"
|
||||
#include "g_cmds.h"
|
||||
#include "bg_misc.h"
|
||||
|
||||
extern void BG_LoadItemNames(void);
|
||||
extern qboolean BG_ParseRankNames ( char* fileName, rankNames_t rankNames[] );
|
||||
|
@ -632,10 +633,10 @@ and transfer to clients
|
|||
**************************/
|
||||
static qboolean G_LoadClassData( char* fileName )
|
||||
{
|
||||
char *buffer;
|
||||
char *textPtr, *token;
|
||||
char *buffer = NULL;
|
||||
char *textPtr = NULL, *token = NULL;
|
||||
int fileLen;
|
||||
fileHandle_t f;
|
||||
fileHandle_t f = 0;
|
||||
qboolean classValid=qfalse;
|
||||
int classIndex=0;
|
||||
int weapon;
|
||||
|
@ -895,25 +896,26 @@ static qboolean G_LoadClassData( char* fileName )
|
|||
}
|
||||
}
|
||||
|
||||
void BG_LanguageFilename(char *baseName,char *baseExtension,char *finalName);
|
||||
void SP_target_location (gentity_t *ent);
|
||||
|
||||
static void G_LoadTimedMessages(void) {
|
||||
fileHandle_t f;
|
||||
bgLex* lexer;
|
||||
char* buffer;
|
||||
fileHandle_t f = 0;
|
||||
bgLex* lexer = NULL;
|
||||
char* buffer = NULL;
|
||||
int len;
|
||||
|
||||
len = trap_FS_FOpenFile("timedmessages.cfg", &f, FS_READ);
|
||||
if(!len) return;
|
||||
if(len == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
buffer = (char *)malloc(sizeof(char) * (len+1));
|
||||
if(!buffer) {
|
||||
if(buffer == NULL) {
|
||||
G_Printf(S_COLOR_RED "ERROR: Was unable to allocate %i byte.\n", (len+1) * sizeof(char) );
|
||||
trap_FS_FCloseFile(f);
|
||||
return;
|
||||
}
|
||||
memset(buffer, 0, len+1);
|
||||
memset(buffer, 0, (size_t)((len + 1) * sizeof(char)));
|
||||
|
||||
level.timedMessages = create_list();
|
||||
if(level.timedMessages == NULL) {
|
||||
|
@ -934,7 +936,7 @@ static void G_LoadTimedMessages(void) {
|
|||
return;
|
||||
}
|
||||
|
||||
while(bgLex_lex(lexer)) {
|
||||
while(bgLex_lex(lexer) != 0) {
|
||||
if(lexer->morphem->type == LMT_STRING) {
|
||||
level.timedMessages->append(level.timedMessages, lexer->morphem->data.str, LT_STRING, strlen(lexer->morphem->data.str));
|
||||
} else {
|
||||
|
@ -951,13 +953,17 @@ holoData_t holoData;
|
|||
static void G_LoadHolodeckFile(void) {
|
||||
char fileRoute[MAX_QPATH];
|
||||
char mapRoute[MAX_QPATH];
|
||||
char *info;
|
||||
fileHandle_t f;
|
||||
char *buffer;
|
||||
char* info = NULL;
|
||||
fileHandle_t f = 0;
|
||||
char* buffer = NULL;
|
||||
int file_len;
|
||||
char *txtPtr, *token;
|
||||
char* txtPtr = NULL;
|
||||
char* token = NULL;
|
||||
int numProgs = 0;
|
||||
|
||||
memset(fileRoute, 0, sizeof(fileRoute));
|
||||
memset(mapRoute, 0, sizeof(mapRoute));
|
||||
|
||||
info = (char *)malloc(MAX_INFO_STRING * sizeof(char));
|
||||
if(!info) {
|
||||
G_Printf(S_COLOR_RED "ERROR: Was unable to allocate %i byte.\n", MAX_INFO_STRING * sizeof(char) );
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
//
|
||||
#include "g_local.h"
|
||||
#include "list.h"
|
||||
#include "bg_misc.h"
|
||||
|
||||
//#include <windows.h> //TiM : WTF?
|
||||
|
||||
//==========================================================
|
||||
|
@ -1543,8 +1545,6 @@ static void target_turbolift_use( gentity_t *self, gentity_t *other, gentity_t *
|
|||
trap_SendServerCommand( activator-g_entities, va("lift %d", self->health) );
|
||||
}
|
||||
|
||||
extern void BG_LanguageFilename(char *baseName,char *baseExtension,char *finalName);
|
||||
|
||||
/*
|
||||
QUAKED target_turbolift (.5 .5 .5) ? x x x x x x x x OFFLINE
|
||||
-----DESCRIPTION-----
|
||||
|
|
Loading…
Reference in New Issue