mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-19 14:25:11 +00:00
bufix: NPC is targeted at the same time it allies with targeter, causing it to try to attack itself
This commit is contained in:
@@ -55,6 +55,10 @@ export class AttackExecution implements Execution {
|
||||
this._owner = mg.player(this._ownerID)
|
||||
this.target = this._targetID == this.mg.terraNullius().id() ? mg.terraNullius() : mg.player(this._targetID)
|
||||
|
||||
if (this._owner == this.target) {
|
||||
throw new Error(`Player ${this._owner} cannot attack itself`)
|
||||
}
|
||||
|
||||
if (this.troops == null) {
|
||||
this.troops = this.mg.config().attackAmount(this._owner, this.target)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user