Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Battlescape/AIModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,13 @@ void AIModule::think(BattleAction *action)
action->target = _patrolAction.target;
break;
case AI_COMBAT:
if (_save->isStealthMission() && _save->getAlarmLevel() == 0 && _save->getGeoscapeSave()->getDifficulty() < 3)
{
action->type = _attackAction.type = BA_NONE;
action->finalAction = true;
}
else
{
action->type = _attackAction.type;
action->target = _attackAction.target;
// this may have changed to a grenade.
Expand Down Expand Up @@ -455,6 +462,7 @@ void AIModule::think(BattleAction *action)
{
action->kneel = _unit->getArmor()->allowsKneeling(false);
}
}
break;
case AI_AMBUSH:
_unit->setCharging(0);
Expand Down
1 change: 0 additions & 1 deletion src/Battlescape/ProjectileFlyBState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,6 @@ void ProjectileFlyBState::projectileHitUnit(Position pos)
{
ai->setWasHitBy(_unit);
_unit->setTurnsSinceSpotted(0);
_unit->setTurnsLeftSpottedForSnipers(std::max(victim->getSpotterDuration(), _unit->getTurnsLeftSpottedForSnipers()));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Battlescape/TileEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2532,7 +2532,7 @@ bool TileEngine::hitUnit(BattleActionAttack attack, BattleUnit *target, const Po
const int stunDamage = target->getStunlevel() - stunLevelOrig;

// hit log
if (attack.attacker)
if (attack.attacker && target->getVisible())
{
if (healthDamage > 0 || stunDamage > 0)
{
Expand Down