mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-11 11:28:03 +07:00
Fix crash when melee unit captures civilian then tries to attack it (#7282)
This commit is contained in:
parent
51caf7a4ed
commit
50a8ff3ce0
@ -58,6 +58,10 @@ object Battle {
|
||||
* but the hidden tile is actually IMPASSIBLE so you stop halfway!
|
||||
*/
|
||||
if (attacker.getTile() != attackableTile.tileToAttackFrom) return false
|
||||
/** Rarely, a melee unit will target a civilian then move through the civilian to get
|
||||
* to attackableTile.tileToAttackFrom, meaning that they take the civilian. This check stops
|
||||
* the melee unit from trying to capture their own unit if this happens */
|
||||
if (getMapCombatantOfTile(attackableTile.tileToAttack)!!.getCivInfo() == attacker.getCivInfo()) return false
|
||||
/** Alternatively, maybe we DID reach that tile, but it turned out to be a hill or something,
|
||||
* so we expended all of our movement points!
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user