Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler errors on more recent compilers. #6

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
24 changes: 12 additions & 12 deletions code/game/AI_GalakMech.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static qboolean enemyLOS;
static qboolean enemyCS;
static qboolean hitAlly;
static qboolean faceEnemy;
static qboolean move;
static qboolean _move;
static qboolean shoot;
static float enemyDist;
static vec3_t impactPos;
Expand Down Expand Up @@ -430,7 +430,7 @@ static void GM_CheckMoveState( void )
{
if ( Q3_TaskIDPending( NPC, TID_MOVE_NAV ) )
{//moving toward a goal that a script is waiting on, so don't stop for anything!
move = qtrue;
_move = qtrue;
}

//See if we're moving towards a goal, not the enemy
Expand Down Expand Up @@ -654,7 +654,7 @@ void NPC_BSGM_Attack( void )
}

enemyLOS = enemyCS = qfalse;
move = qtrue;
_move = qtrue;
faceEnemy = qfalse;
shoot = qfalse;
hitAlly = qfalse;
Expand Down Expand Up @@ -969,7 +969,7 @@ void NPC_BSGM_Attack( void )
}
if ( NPCInfo->goalEntity == NPC->enemy )
{//for now, always chase the enemy
move = qtrue;
_move = qtrue;
}
}
if ( enemyCS )
Expand All @@ -985,7 +985,7 @@ void NPC_BSGM_Attack( void )
}
if ( NPCInfo->goalEntity == NPC->enemy )
{//for now, always chase the enemy
move = qtrue;
_move = qtrue;
}
}

Expand Down Expand Up @@ -1048,17 +1048,17 @@ void NPC_BSGM_Attack( void )

if ( !TIMER_Done( NPC, "standTime" ) )
{
move = qfalse;
_move = qfalse;
}
if ( !(NPCInfo->scriptFlags&SCF_CHASE_ENEMIES) )
{//not supposed to chase my enemies
if ( NPCInfo->goalEntity == NPC->enemy )
{//goal is my entity, so don't move
move = qfalse;
_move = qfalse;
}
}

if ( move && !NPC->lockCount )
if ( _move && !NPC->lockCount )
{//move toward goal
if ( NPCInfo->goalEntity
&& NPC->client->ps.legsAnim != BOTH_ALERT1
Expand All @@ -1067,11 +1067,11 @@ void NPC_BSGM_Attack( void )
&& NPC->client->ps.legsAnim != BOTH_ATTACK5
&& NPC->client->ps.legsAnim != BOTH_ATTACK7 )
{
move = GM_Move();
_move = GM_Move();
}
else
{
move = qfalse;
_move = qfalse;
}
}

Expand All @@ -1084,11 +1084,11 @@ void NPC_BSGM_Attack( void )

if ( !faceEnemy )
{//we want to face in the dir we're running
if ( !move )
if ( _move == qfalse)
{//if we haven't moved, we should look in the direction we last looked?
VectorCopy( NPC->client->ps.viewangles, NPCInfo->lastPathAngles );
}
if ( move )
if ( _move == qtrue)
{//don't run away and shoot
NPCInfo->desiredYaw = NPCInfo->lastPathAngles[YAW];
NPCInfo->desiredPitch = 0;
Expand Down
20 changes: 10 additions & 10 deletions code/game/AI_Grenadier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ qboolean NPC_CheckPlayerTeamStealth( void );
static qboolean enemyLOS;
static qboolean enemyCS;
static qboolean faceEnemy;
static qboolean move;
static qboolean _move;
static qboolean shoot;
static float enemyDist;

Expand Down Expand Up @@ -311,7 +311,7 @@ static void Grenadier_CheckMoveState( void )
{
if ( NPCInfo->goalEntity == NPC->enemy )
{
move = qfalse;
_move = qfalse;
return;
}
}
Expand Down Expand Up @@ -489,7 +489,7 @@ void NPC_BSGrenadier_Attack( void )
}

enemyLOS = enemyCS = qfalse;
move = qtrue;
_move = qtrue;
faceEnemy = qfalse;
shoot = qfalse;
enemyDist = DistanceSquared( NPC->enemy->currentOrigin, NPC->currentOrigin );
Expand Down Expand Up @@ -580,11 +580,11 @@ void NPC_BSGrenadier_Attack( void )
shoot = qtrue;
if ( NPC->client->ps.weapon == WP_THERMAL )
{//don't chase and throw
move = qfalse;
_move = qfalse;
}
else if ( NPC->client->ps.weapon == WP_MELEE && enemyDist < (NPC->maxs[0]+NPC->enemy->maxs[0]+16)*(NPC->maxs[0]+NPC->enemy->maxs[0]+16) )
{//close enough
move = qfalse;
_move = qfalse;
}
}//this should make him chase enemy when out of range...?

Expand All @@ -594,19 +594,19 @@ void NPC_BSGrenadier_Attack( void )
//See if we should override shooting decision with any special considerations
Grenadier_CheckFireState();

if ( move )
if ( _move )
{//move toward goal
if ( NPCInfo->goalEntity )//&& ( NPCInfo->goalEntity != NPC->enemy || enemyDist > 10000 ) )//100 squared
{
move = Grenadier_Move();
_move = Grenadier_Move();
}
else
{
move = qfalse;
_move = qfalse;
}
}

if ( !move )
if ( !_move )
{
if ( !TIMER_Done( NPC, "duck" ) )
{
Expand All @@ -621,7 +621,7 @@ void NPC_BSGrenadier_Attack( void )

if ( !faceEnemy )
{//we want to face in the dir we're running
if ( move )
if ( _move )
{//don't run away and shoot
NPCInfo->desiredYaw = NPCInfo->lastPathAngles[YAW];
NPCInfo->desiredPitch = 0;
Expand Down
18 changes: 9 additions & 9 deletions code/game/AI_Sniper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ qboolean NPC_CheckPlayerTeamStealth( void );
static qboolean enemyLOS;
static qboolean enemyCS;
static qboolean faceEnemy;
static qboolean move;
static qboolean _move;
static qboolean shoot;
static float enemyDist;

Expand Down Expand Up @@ -318,7 +318,7 @@ static void Sniper_CheckMoveState( void )
{
if ( NPCInfo->goalEntity == NPC->enemy )
{
move = qfalse;
_move = qfalse;
return;
}
}
Expand All @@ -338,7 +338,7 @@ static void Sniper_CheckMoveState( void )
{
if ( !NPCInfo->goalEntity )
{
move = qfalse;
_move = qfalse;
return;
}
}
Expand Down Expand Up @@ -668,7 +668,7 @@ void NPC_BSSniper_Attack( void )
}

enemyLOS = enemyCS = qfalse;
move = qtrue;
_move = qtrue;
faceEnemy = qfalse;
shoot = qfalse;
enemyDist = DistanceSquared( NPC->currentOrigin, NPC->enemy->currentOrigin );
Expand Down Expand Up @@ -759,19 +759,19 @@ void NPC_BSSniper_Attack( void )
//See if we should override shooting decision with any special considerations
Sniper_CheckFireState();

if ( move )
if ( _move )
{//move toward goal
if ( NPCInfo->goalEntity )//&& ( NPCInfo->goalEntity != NPC->enemy || enemyDist > 10000 ) )//100 squared
{
move = Sniper_Move();
_move = Sniper_Move();
}
else
{
move = qfalse;
_move = qfalse;
}
}

if ( !move )
if ( !_move )
{
if ( !TIMER_Done( NPC, "duck" ) )
{
Expand Down Expand Up @@ -804,7 +804,7 @@ void NPC_BSSniper_Attack( void )

if ( !faceEnemy )
{//we want to face in the dir we're running
if ( move )
if ( _move )
{//don't run away and shoot
NPCInfo->desiredYaw = NPCInfo->lastPathAngles[YAW];
NPCInfo->desiredPitch = 0;
Expand Down
36 changes: 18 additions & 18 deletions code/game/AI_Stormtrooper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static qboolean enemyCS;
static qboolean enemyInFOV;
static qboolean hitAlly;
static qboolean faceEnemy;
static qboolean move;
static qboolean _move;
static qboolean shoot;
static float enemyDist;
static vec3_t impactPos;
Expand Down Expand Up @@ -1186,15 +1186,15 @@ static void ST_CheckMoveState( void )
{
if ( Q3_TaskIDPending( NPC, TID_MOVE_NAV ) )
{//moving toward a goal that a script is waiting on, so don't stop for anything!
move = qtrue;
_move = qtrue;
}
//See if we're a scout
else if ( NPCInfo->squadState == SQUAD_SCOUT )
{
//If we're supposed to stay put, then stand there and fire
if ( TIMER_Done( NPC, "stick" ) == qfalse )
{
move = qfalse;
_move = qfalse;
return;
}

Expand All @@ -1207,7 +1207,7 @@ static void ST_CheckMoveState( void )
if ( NPCInfo->goalEntity == NPC->enemy )
{
AI_GroupUpdateSquadstates( NPCInfo->group, NPC, SQUAD_STAND_AND_SHOOT );
move = qfalse;
_move = qfalse;
return;
}
}
Expand Down Expand Up @@ -1260,28 +1260,28 @@ static void ST_CheckMoveState( void )
return;
}

move = qfalse;
_move = qfalse;
return;
}
//see if we're just standing around
else if ( NPCInfo->squadState == SQUAD_STAND_AND_SHOOT )
{//from this squadState we can transition to others?
move = qfalse;
_move = qfalse;
return;
}
//see if we're hiding
else if ( NPCInfo->squadState == SQUAD_COVER )
{
//Should we duck?
move = qfalse;
_move = qfalse;
return;
}
//see if we're just standing around
else if ( NPCInfo->squadState == SQUAD_IDLE )
{
if ( !NPCInfo->goalEntity )
{
move = qfalse;
_move = qfalse;
return;
}
}
Expand Down Expand Up @@ -2452,7 +2452,7 @@ void NPC_BSST_Attack( void )
}

enemyLOS = enemyCS = enemyInFOV = qfalse;
move = qtrue;
_move = qtrue;
faceEnemy = qfalse;
shoot = qfalse;
hitAlly = qfalse;
Expand Down Expand Up @@ -2585,28 +2585,28 @@ void NPC_BSST_Attack( void )
{//not supposed to chase my enemies
if ( NPCInfo->goalEntity == NPC->enemy )
{//goal is my entity, so don't move
move = qfalse;
_move = qfalse;
}
}

if ( NPC->client->fireDelay && NPC->s.weapon == WP_ROCKET_LAUNCHER )
{
move = qfalse;
_move = qfalse;
}

if ( move )
if ( _move )
{//move toward goal
if ( NPCInfo->goalEntity )//&& ( NPCInfo->goalEntity != NPC->enemy || enemyDist > 10000 ) )//100 squared
{
move = ST_Move();
_move = ST_Move();
}
else
{
move = qfalse;
_move = qfalse;
}
}

if ( !move )
if ( !_move )
{
if ( !TIMER_Done( NPC, "duck" ) )
{
Expand All @@ -2628,14 +2628,14 @@ void NPC_BSST_Attack( void )

if ( !faceEnemy )
{//we want to face in the dir we're running
if ( !move )
if ( !_move )
{//if we haven't moved, we should look in the direction we last looked?
VectorCopy( NPC->client->ps.viewangles, NPCInfo->lastPathAngles );
}
NPCInfo->desiredYaw = NPCInfo->lastPathAngles[YAW];
NPCInfo->desiredPitch = 0;
NPC_UpdateAngles( qtrue, qtrue );
if ( move )
if ( _move )
{//don't run away and shoot
shoot = qfalse;
}
Expand Down Expand Up @@ -2679,7 +2679,7 @@ void NPC_BSST_Attack( void )
//NASTY
if ( NPC->s.weapon == WP_ROCKET_LAUNCHER
&& (ucmd.buttons&BUTTON_ATTACK)
&& !move
&& !_move
&& g_spskill->integer > 1
&& !Q_irand( 0, 3 ) )
{//every now and then, shoot a homing rocket
Expand Down
Loading