From 4b7b3e3d307e976912230deda40595a3c9af2cff Mon Sep 17 00:00:00 2001 From: Ben Millwood Date: Tue, 24 Nov 2009 20:27:08 +0000 Subject: * Don't return an in-use trail system when no empty slot could be found --- src/cgame/cg_trails.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/cgame/cg_trails.c') diff --git a/src/cgame/cg_trails.c b/src/cgame/cg_trails.c index 74a18e7f..05f5ef5e 100644 --- a/src/cgame/cg_trails.c +++ b/src/cgame/cg_trails.c @@ -1262,11 +1262,14 @@ static trailBeam_t *CG_SpawnNewTrailBeam( baseTrailBeam_t *btb, if( cg_debugTrails.integer >= 1 ) CG_Printf( "TB %s created\n", ts->class->name ); - break; + return tb; } } - return tb; + if( cg_debugTrails.integer >= 1 ) + CG_Printf( "MAX_TRAIL_BEAMS\n" ); + + return NULL; } @@ -1310,11 +1313,14 @@ trailSystem_t *CG_SpawnNewTrailSystem( qhandle_t psHandle ) if( cg_debugTrails.integer >= 1 ) CG_Printf( "TS %s created\n", bts->name ); - break; + return ts; } } - return ts; + if( cg_debugTrails.integer >= 1 ) + CG_Printf( "MAX_TRAIL_SYSTEMS\n" ); + + return NULL; } /* -- cgit