mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-30 21:23:27 +00:00
fix boat only captures single tile bug
This commit is contained in:
@@ -46,14 +46,14 @@ export class AttackExecution implements Execution {
|
||||
if (!this.active) {
|
||||
return
|
||||
}
|
||||
this.mg = mg
|
||||
|
||||
this.targetCell = null
|
||||
|
||||
this._owner = mg.player(this._ownerID)
|
||||
this.target = this._targetID == null ? mg.terraNullius() : mg.player(this._targetID)
|
||||
this.target = this._targetID == this.mg.terraNullius().id() ? mg.terraNullius() : mg.player(this._targetID)
|
||||
this.troops = Math.min(this._owner.troops(), this.troops)
|
||||
this._owner.setTroops(this._owner.troops() - this.troops)
|
||||
this.mg = mg
|
||||
|
||||
for (const exec of mg.executions()) {
|
||||
if (exec.isActive() && exec instanceof AttackExecution && exec != this) {
|
||||
|
||||
@@ -57,7 +57,7 @@ export class BoatAttackExecution implements Execution {
|
||||
return
|
||||
}
|
||||
|
||||
if (this.targetID == null) {
|
||||
if (this.targetID == null || this.targetID == this.mg.terraNullius().id()) {
|
||||
this.target = mg.terraNullius()
|
||||
} else {
|
||||
this.target = mg.player(this.targetID)
|
||||
@@ -67,11 +67,7 @@ export class BoatAttackExecution implements Execution {
|
||||
this.attacker.removeTroops(this.troops)
|
||||
|
||||
this.src = this.closestShoreTile(this.attacker, this.cell)
|
||||
if (this.target.isPlayer()) {
|
||||
this.dst = this.closestShoreTile(this.target, this.cell)
|
||||
} else {
|
||||
this.dst = this.mg.tile(this.cell)
|
||||
}
|
||||
this.dst = this.mg.tile(this.cell)
|
||||
|
||||
if (this.src == null || this.dst == null) {
|
||||
this.active = false
|
||||
|
||||
Reference in New Issue
Block a user