From 3e93946d0bdbcdf32b922c88c8c84d4e393820a1 Mon Sep 17 00:00:00 2001 From: Walter Julius Hennecke Date: Fri, 17 May 2013 20:46:51 +0200 Subject: [PATCH] splint warning fixed in g_main.c --- code/game/g_cmds.h | 1 + code/game/g_local.h | 2 +- code/game/g_main.c | 15 +++++++++------ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/code/game/g_cmds.h b/code/game/g_cmds.h index 0e89bb8..e9a16b3 100644 --- a/code/game/g_cmds.h +++ b/code/game/g_cmds.h @@ -4,5 +4,6 @@ #include "g_local.h" qboolean SetClass( gentity_t *ent, char *s, /*@null@*/ char *teamName, qboolean SaveToCvar ); +void DragCheck( void ); #endif \ No newline at end of file diff --git a/code/game/g_local.h b/code/game/g_local.h index 4de1f4b..91668a6 100644 --- a/code/game/g_local.h +++ b/code/game/g_local.h @@ -2618,7 +2618,7 @@ extern vmCvar_t g_developer; // Prevents a single statement from beeing executed if developer isn't set #define DEVELOPER(X) if(g_developer.integer != 0) { \ X\ - } else + } #include "g_team.h" // teamplay specific stuff diff --git a/code/game/g_main.c b/code/game/g_main.c index 3a39fe7..ffb49e3 100644 --- a/code/game/g_main.c +++ b/code/game/g_main.c @@ -2568,6 +2568,10 @@ Runs thinking code for this frame if necessary void G_RunThink (gentity_t *ent) { float thinktime; + if(ent == NULL) { + return; + } + thinktime = ent->nextthink; if (thinktime <= 0) { return; @@ -2577,13 +2581,13 @@ void G_RunThink (gentity_t *ent) { } ent->nextthink = 0; - if (!ent->think) { + if (ent->think == NULL) { G_Error ( "NULL ent->think"); return; } #ifdef G_LUA - if(ent->luaThink && !ent->client) + if(ent->luaThink != NULL && ent->client == NULL) { LuaHook_G_EntityThink(ent->luaThink, ent->s.number); } @@ -2600,7 +2604,6 @@ Advances the non-player objects in the world ================ */ -void DragCheck( void ); //RPG-X: J2J - Added to rid warning. void CheckHealthInfoMessage( void ); void G_RunFrame( int levelTime ) { int i; @@ -2731,15 +2734,15 @@ void G_RunFrame( int levelTime ) { client = ent->client; - if (!(client->pers.cmd.buttons & BUTTON_USE)) { + if ((client->pers.cmd.buttons & BUTTON_USE) == 0) { client->pressedUse = qfalse; } if (g_classData[client->sess.sessionClass].isn00b == qtrue) { - if ((client->n00bTime != -1) && (client->n00bTime <= level.time) && client->origClass) + if ((client->n00bTime != -1) && (client->n00bTime <= level.time) && client->origClass[0] != 0) { - if(!SetClass( ent, client->origClass, NULL, qtrue )) { + if(SetClass( ent, client->origClass, NULL, qtrue ) == qfalse) { DEVELOPER(G_Printf(S_COLOR_YELLOW "G_RunFrame - Warning: SetClass failed!\n");); } }