From 3864f3233c2ce7ccce4ac05a44bed7c200836543 Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Sat, 12 Jul 2014 16:18:47 +0200 Subject: remedy some code failures (not sure about the effects) --- src/cgame/cg_buildable.c | 2 +- src/game/g_buildable.c | 8 +++----- src/game/g_cmds.c | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c index 9b1d8d4..9821bbc 100644 --- a/src/cgame/cg_buildable.c +++ b/src/cgame/cg_buildable.c @@ -2216,7 +2216,7 @@ void CG_Cuboid_Response(void) // cb2 : server sets client-side cuboid // cb3 : server agrees on player's cuboid // cb4 : server disagrees on player's cuboid - int offs; + int offs = 0; if( !BG_Buildable( cg.predictedPlayerState.stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT, NULL )->cuboid ) return; diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 3114792..efac6b3 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -2407,10 +2407,8 @@ void HMGTurret_Think( gentity_t *self ) if( !self->powered ) { // if power loss drop turret - if( self->spawned && - HMGTurret_State( self, MGT_STATE_INACTIVE ) ); - return; - + if( self->spawned ) + HMGTurret_State( self, MGT_STATE_INACTIVE ); return; } if( !self->spawned ) @@ -3736,7 +3734,7 @@ static gentity_t *G_FinishSpawningBuildable( gentity_t *ent, qboolean force ) else VectorSet( normal, 0.0f, 0.0f, 1.0f ); - built = G_Build( ent, buildable, ent->s.pos.trBase, normal, ent->s.angles, built->cuboidSize ); + built = G_Build( ent, buildable, ent->s.pos.trBase, normal, ent->s.angles, ent->cuboidSize ); built->takedamage = qtrue; built->spawned = qtrue; //map entities are already spawned diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index f3eaa83..16bc9b9 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -2616,6 +2616,8 @@ void Cmd_Build_f( gentity_t *ent ) buildable = BG_BuildableByName( s )->number; + team = ent->client->ps.stats[ STAT_TEAM ]; + /* To allow players build cuboids with completely arbitrary * dimensions (the current resizing method doesn't provide * much precision) the build command was extended with the @@ -2667,8 +2669,6 @@ void Cmd_Build_f( gentity_t *ent ) return; } - team = ent->client->ps.stats[ STAT_TEAM ]; - if( buildable != BA_NONE && ( ( 1 << ent->client->ps.weapon ) & BG_Buildable( buildable, NULL )->buildWeapon ) && BG_BuildableIsAllowed( buildable ) && -- cgit