diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_misc.c | 7 | ||||
-rw-r--r-- | src/game/g_admin.c | 4 | ||||
-rw-r--r-- | src/game/g_local.h | 2 |
3 files changed, 9 insertions, 4 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 2b4fa29..0ebcc55 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -3892,9 +3892,14 @@ void BG_FindAmmoForWeapon( int weapon, int *maxAmmo, int *maxClips ) *maxClips = bg_weapons[ i ].maxClips; //no need to keep going - break; + return; } } + + if( maxAmmo != NULL ) + *maxAmmo = 0; + if( maxClips != NULL ) + *maxClips = 0; } /* diff --git a/src/game/g_admin.c b/src/game/g_admin.c index 1becfa8..90e33c4 100644 --- a/src/game/g_admin.c +++ b/src/game/g_admin.c @@ -1828,7 +1828,7 @@ void G_admin_namelog_update( gclient_t *client, qboolean disconnect ) return; } namelog = G_Alloc( sizeof( g_admin_namelog_t ) ); - memset( namelog, 0, sizeof( namelog ) ); + memset( namelog, 0, sizeof( *namelog ) ); for( j = 0; j < MAX_ADMIN_NAMELOG_NAMES ; j++ ) namelog->name[ j ][ 0 ] = '\0'; Q_strncpyz( namelog->ip, client->pers.ip, sizeof( namelog->ip ) ); @@ -3613,7 +3613,7 @@ void G_admin_adminlog_log( gentity_t *ent, char *command, char *args, int skipar else adminlog = G_Alloc( sizeof( g_admin_adminlog_t ) ); - memset( adminlog, 0, sizeof( adminlog ) ); + memset( adminlog, 0, sizeof( *adminlog ) ); adminlog->id = count; adminlog->time = level.time - level.startTime; adminlog->success = success; diff --git a/src/game/g_local.h b/src/game/g_local.h index 2294f6f..5ca1f96 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -1306,7 +1306,7 @@ connectionRecord_t *G_FindConnectionForCode( int code ); extern level_locals_t level; extern gentity_t g_entities[ MAX_GENTITIES ]; -#define FOFS(x) ((int)&(((gentity_t *)0)->x)) +#define FOFS(x) ((size_t)&(((gentity_t *)0)->x)) //spree values #define SPREE_FEED_VALUE 120 |