mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
Fix: if sneaking undetected near an enemy, saving and reloading increased agility.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7569 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -4789,31 +4789,36 @@ void SOLDIERTYPE::SetSoldierGridNo( INT32 sNewGridNo, BOOLEAN fForceRemove )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( this->bTeam == gbPlayerNum && this->bStealthMode )
|
// Flugente: award agility stat increase if we sneak upon an enemy undetected
|
||||||
|
// do NOT award this bonus if we are currently loading a game - otherwise one could increase agility by repeatedly saving and reloading the game
|
||||||
|
if ( !(gTacticalStatus.uiFlags & LOADING_SAVED_GAME) )
|
||||||
{
|
{
|
||||||
// Merc got to a new tile by "sneaking". Did we theoretically sneak
|
if ( this->bTeam == gbPlayerNum && this->bStealthMode )
|
||||||
// past an enemy?
|
|
||||||
|
|
||||||
if ( this->aiData.bOppCnt > 0 ) // opponents in sight
|
|
||||||
{
|
{
|
||||||
// check each possible enemy
|
// Merc got to a new tile by "sneaking". Did we theoretically sneak
|
||||||
for ( cnt = 0; cnt < MAX_NUM_SOLDIERS; cnt++ )
|
// past an enemy?
|
||||||
|
|
||||||
|
if ( this->aiData.bOppCnt > 0 ) // opponents in sight
|
||||||
{
|
{
|
||||||
pEnemy = MercPtrs[cnt];
|
// check each possible enemy
|
||||||
// if this guy is here and alive enough to be looking for us
|
for ( cnt = 0; cnt < MAX_NUM_SOLDIERS; ++cnt )
|
||||||
if ( pEnemy->bActive && pEnemy->bInSector && (pEnemy->stats.bLife >= OKLIFE) )
|
|
||||||
{
|
{
|
||||||
// no points for sneaking by the neutrals & friendlies!!!
|
pEnemy = MercPtrs[cnt];
|
||||||
if ( !pEnemy->aiData.bNeutral && (this->bSide != pEnemy->bSide) && (pEnemy->ubBodyType != COW && pEnemy->ubBodyType != CROW) )
|
// if this guy is here and alive enough to be looking for us
|
||||||
|
if ( pEnemy->bActive && pEnemy->bInSector && (pEnemy->stats.bLife >= OKLIFE) )
|
||||||
{
|
{
|
||||||
// if we SEE this particular oppponent, and he DOESN'T see us... and he COULD see us...
|
// no points for sneaking by the neutrals & friendlies!!!
|
||||||
if ( (this->aiData.bOppList[cnt] == SEEN_CURRENTLY) &&
|
if ( !pEnemy->aiData.bNeutral && (this->bSide != pEnemy->bSide) && (pEnemy->ubBodyType != COW && pEnemy->ubBodyType != CROW) )
|
||||||
pEnemy->aiData.bOppList[this->ubID] != SEEN_CURRENTLY &&
|
|
||||||
PythSpacesAway( this->sGridNo, pEnemy->sGridNo ) < pEnemy->GetMaxDistanceVisible( this->sGridNo, this->pathing.bLevel ) )
|
|
||||||
{
|
{
|
||||||
// AGILITY (5): Soldier snuck 1 square past unaware enemy
|
// if we SEE this particular oppponent, and he DOESN'T see us... and he COULD see us...
|
||||||
StatChange( this, AGILAMT, 5, FALSE );
|
if ( (this->aiData.bOppList[cnt] == SEEN_CURRENTLY) &&
|
||||||
// Keep looping, we'll give'em 1 point for EACH such enemy!
|
pEnemy->aiData.bOppList[this->ubID] != SEEN_CURRENTLY &&
|
||||||
|
PythSpacesAway( this->sGridNo, pEnemy->sGridNo ) < pEnemy->GetMaxDistanceVisible( this->sGridNo, this->pathing.bLevel ) )
|
||||||
|
{
|
||||||
|
// AGILITY (5): Soldier snuck 1 square past unaware enemy
|
||||||
|
StatChange( this, AGILAMT, 5, FALSE );
|
||||||
|
// Keep looping, we'll give'em 1 point for EACH such enemy!
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4823,11 +4828,6 @@ void SOLDIERTYPE::SetSoldierGridNo( INT32 sNewGridNo, BOOLEAN fForceRemove )
|
|||||||
|
|
||||||
// Adjust speed based on terrain, etc
|
// Adjust speed based on terrain, etc
|
||||||
SetSoldierAniSpeed( this );
|
SetSoldierAniSpeed( this );
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//int breakpoint = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user