mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
nullkiller2: Ivan PR review: Remove invalid attack position validation log and return empty attackable tiles
This commit is contained in:
@@ -1409,19 +1409,6 @@ AttackableTiles CBattleInfoCallback::getPotentiallyAttackableHexes(
|
||||
if(attacker->doubleWide() && !vstd::contains(defender->getSurroundingHexes(defenderPos), attackOriginHex))
|
||||
attackOriginHex = attacker->occupiedHex(attackOriginHex);
|
||||
|
||||
if (!vstd::contains(defender->getSurroundingHexes(defenderPos), attackOriginHex))
|
||||
{
|
||||
// Fixed in PR #6016 but left as a graceful error log instead of a runtime exception that crashes
|
||||
logGlobal->error(
|
||||
"Attempt to attack from invalid position! defenderPos (%d, %d) attackOriginHex (%d, %d)",
|
||||
defenderPos.getX(),
|
||||
defenderPos.getY(),
|
||||
attackOriginHex.getX(),
|
||||
attackOriginHex.getY()
|
||||
);
|
||||
return AttackableTiles();
|
||||
}
|
||||
|
||||
auto attackDirection = BattleHex::mutualPosition(attackOriginHex, defenderPos);
|
||||
|
||||
// If defender is double-wide, attacker always prefers targeting its 'tail', if it is reachable
|
||||
|
||||
Reference in New Issue
Block a user