---- /dev/humancontroller  ---- 84eff69 fix QVM compilation, part 1: move variable declarations to the beginning of the code block diff --git src/game/g_admin.c src/game/g_admin.c index 42fba56..5da2fb4 100644 --- src/game/g_admin.c +++ src/game/g_admin.c @@ -2065,8 +2065,9 @@ extern void G_ExplodeMissile( gentity_t *ent ); qboolean DrawNodes( gentity_t *ent, qboolean clear ) { int i, i2; - qboolean found = qfalse; - gentity_t *target; + qboolean found = qfalse; + qboolean delpath = qfalse; + gentity_t *target; // Primero borramos todas las entidades mostrando nodos (classname=="nodedraw") // Si se encontro aunque sea una se termina la accion (quiere decir que // quiso desactivar el modo devdraw. @@ -2085,7 +2086,6 @@ qboolean DrawNodes( gentity_t *ent, qboolean clear ) } if (found == qtrue) { return qtrue; } } - qboolean delpath = qfalse; for ( i = 0; i < level.numPaths; i++ ) { for (i2 = 0; i2 < 5; i2++) diff --git src/game/g_bot.c src/game/g_bot.c index 41695c5..67c2de1 100644 --- src/game/g_bot.c +++ src/game/g_bot.c @@ -88,10 +88,11 @@ void G_BotAdd( char *name, int team, int skill, int ignore ) { { if ( len <= 2000 ) { + char *token, *p; trap_FS_Read( buffer, len, fileHandle ); buffer[len] = 0; trap_FS_FCloseFile( fileHandle ); - char *token, *p; p = buffer; + p = buffer; while (1) { @@ -2044,6 +2045,7 @@ void G_BotThink( gentity_t *self ) } if(followFriend) { + int maxdist = 350; //botAimAtTarget(self, self->botFriend); distance = botGetDistanceBetweenPlayer(self, self->botFriend); // enable wallwalk @@ -2081,7 +2083,6 @@ void G_BotThink( gentity_t *self ) } } } - int maxdist = 350; if (BG_InventoryContainsUpgrade( UP_BATTLESUIT, self->client->ps.stats )) { maxdist = 450; @@ -2176,6 +2177,7 @@ void G_BotThink( gentity_t *self ) //ROTAX if(self->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS) { + int uhyb = 0; // enable wallwalk if( BG_ClassHasAbility( self->client->ps.stats[ STAT_PCLASS ], SCA_WALLCLIMBER ) ) { @@ -2198,7 +2200,6 @@ void G_BotThink( gentity_t *self ) } //self->client->pers.cmd.upmove = -1; - int uhyb = 0; self->client->pers.cmd.forwardmove = botForwardIfSecure( self, forwardMove ); if (g_ambush_dodge_random.integer <= 0) g_ambush_dodge_random.integer = 1; @@ -2435,6 +2436,7 @@ void G_BotThink( gentity_t *self ) } pathfinding(self); //Roam the map!!! } else { + int tDistance; // Para disparar no de tan cerca if (self->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS) { self->timeFoundPath = level.time - (int)(random()*1200); @@ -2445,7 +2447,6 @@ void G_BotThink( gentity_t *self ) self->state = FINDNEWPATH; } // enemy! - int tDistance; // Para disparar no de tan cerca //distance = botGetDistanceBetweenPlayer(self, self->botEnemy); botAimAtTarget(self, self->botEnemy); @@ -2499,6 +2500,7 @@ void G_BotThink( gentity_t *self ) //ROTAX if(self->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS) { + int uhyb = 0; // enable wallwalk if( BG_ClassHasAbility( self->client->ps.stats[ STAT_PCLASS ], SCA_WALLCLIMBER ) ) { @@ -2521,7 +2523,6 @@ void G_BotThink( gentity_t *self ) } //self->client->pers.cmd.upmove = -1; - int uhyb = 0; self->client->pers.cmd.forwardmove = botForwardIfSecure( self, forwardMove ); if (g_ambush_dodge_random.integer <= 0) g_ambush_dodge_random.integer = 1; @@ -2571,6 +2572,8 @@ int Bot_GetAmbushAlienClass( void ) extern void ambush_next_stage( void ); void G_BotSpectatorThink( gentity_t *self ) { + int i, NumHumansPlayers = 0, NumHumansBots = 0, numclients = 0; + gentity_t *bot; //self->client->ps.pm_type = PM_FREEZE; // Hay una mierda de que mato companyeros a lo loco // aunque ya estan muertos!!! como hago??? @@ -2598,8 +2601,6 @@ void G_BotSpectatorThink( gentity_t *self ) { return; } - int i, NumHumansPlayers = 0, NumHumansBots = 0, numclients = 0; - gentity_t *bot; for( i = 0; i < level.maxclients; i++ ) { bot = &g_entities[ i ]; @@ -2647,7 +2648,8 @@ void G_BotSpectatorThink( gentity_t *self ) { self->client->bottimeRespawn = 0; self->takedamage = qtrue; - //if( self->client->sess.sessionTeam == TEAM_SPECTATOR ) { + //if( self->client->sess.sessionTeam == TEAM_SPECTATOR ) + { int teamnum = self->client->pers.teamSelection; int clientNum = self->client->ps.clientNum; @@ -2706,7 +2708,7 @@ void G_BotSpectatorThink( gentity_t *self ) { } } } - //} + } } diff --git src/game/g_cmds.c src/game/g_cmds.c index 373483b..098a21a 100644 --- src/game/g_cmds.c +++ src/game/g_cmds.c @@ -4550,6 +4550,8 @@ void Cmd_Node_f( gentity_t *ent ) } else if( !Q_stricmp( cmd, "add" ) ) { + qboolean found = qfalse; + gentity_t *target; if(numnearby > 0) { trap_SendServerCommand( ent-g_entities, @@ -4606,8 +4608,6 @@ void Cmd_Node_f( gentity_t *ent ) level.numPaths++; } // Update drawing - qboolean found = qfalse; - gentity_t *target; for ( i = 0; i < MAX_GENTITIES; i++ ) { target = &g_entities[ i ]; @@ -4754,6 +4754,8 @@ void Cmd_Node_f( gentity_t *ent ) } else if( !Q_stricmp( cmd, "move" ) ) { + qboolean found = qfalse; + gentity_t *target; ent->discpathid = -1; ent->pathid = -1; if(ent->movepathid < 0 || ent->movepathid >= level.numPaths) @@ -4787,8 +4789,6 @@ void Cmd_Node_f( gentity_t *ent ) } else{ent->movepathid = -1;} // Update drawing - qboolean found = qfalse; - gentity_t *target; for ( i = 0; i < MAX_GENTITIES; i++ ) { target = &g_entities[ i ]; @@ -4806,6 +4806,8 @@ void Cmd_Node_f( gentity_t *ent ) } else if( !Q_stricmp( cmd, "delete" ) ) { + qboolean found = qfalse; + gentity_t *target; ent->movepathid = -1; ent->pathid = -1; ent->discpathid = -1; @@ -4833,8 +4835,6 @@ void Cmd_Node_f( gentity_t *ent ) trap_SendServerCommand( ent-g_entities, va("print \"Deleted Node #%d. It remains disabled until written over. Links to other paths removed.\n\"", nearbynodeid[0])); // Update drawing - qboolean found = qfalse; - gentity_t *target; for ( i = 0; i < MAX_GENTITIES; i++ ) { target = &g_entities[ i ]; diff --git src/game/g_combat.c src/game/g_combat.c index 6591d63..4358561 100644 --- src/game/g_combat.c +++ src/game/g_combat.c @@ -444,6 +444,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int { if( self->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) { + float classValue = BG_FindValueOfClass( self->client->ps.stats[ STAT_PCLASS ] ); // Invasion Alienigena // Si un alien muere estando en el maximo stage posible // pierde un credito. @@ -453,7 +454,6 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int } //nice simple happy bouncy human land - float classValue = BG_FindValueOfClass( self->client->ps.stats[ STAT_PCLASS ] ); for( i = 0; i < MAX_CLIENTS; i++ ) { diff --git src/game/g_missile.c src/game/g_missile.c index aa45206..9b29aa8 100644 --- src/game/g_missile.c +++ src/game/g_missile.c @@ -403,6 +403,7 @@ fire_blaster gentity_t *fire_blaster( gentity_t *self, vec3_t start, vec3_t dir ) { gentity_t *bolt; + int speed = BLASTER_SPEED; VectorNormalize (dir); @@ -430,7 +431,6 @@ gentity_t *fire_blaster( gentity_t *self, vec3_t start, vec3_t dir ) bolt->s.weapon = WP_PULSE_RIFLE; } - int speed = BLASTER_SPEED; if (BG_InventoryContainsWeapon( WP_MASS_DRIVER, self->client->ps.stats )) { bolt->damage = MDRIVER_SPLASHDMG; diff --git src/game/g_target.c src/game/g_target.c index 2b36a06..12f176e 100644 --- src/game/g_target.c +++ src/game/g_target.c @@ -338,12 +338,12 @@ void target_rumble_think( gentity_t *self ) int i; gentity_t *ent; - if( self->last_move_time < level.time ) - self->last_move_time = level.time + 0.5; - float crand1 = crandom( ) * 150; float crand2 = crandom( ) * 150; + if( self->last_move_time < level.time ) + self->last_move_time = level.time + 0.5; + for( i = 0, ent = g_entities + i; i < level.num_entities; i++, ent++ ) { if( !ent->inuse )