From 6834f0683f7f4be6c85d7f323174ebda0e00e585 Mon Sep 17 00:00:00 2001 From: Ilan Schemoul Date: Fri, 28 Mar 2025 00:39:37 +0100 Subject: [PATCH] embargo if attacked (#353) ## Responsibility Acknowledgment - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through basic manual testing: - Significantly slows down the entire development process - Blocks releases and new features for all contributors - Harms the project's reliability and reputation - Places additional debugging burden on maintainers who already have limited time - Diverts valuable resources away from new development and improvements - Makes me seen as a loser - Makes me more likely to go to hell --- src/core/execution/AttackExecution.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/execution/AttackExecution.ts b/src/core/execution/AttackExecution.ts index 198bc176e..08dc212d2 100644 --- a/src/core/execution/AttackExecution.ts +++ b/src/core/execution/AttackExecution.ts @@ -81,6 +81,10 @@ export class AttackExecution implements Execution { ? mg.terraNullius() : mg.player(this._targetID); + if (this.target && this.target.isPlayer()) { + (this.target as Player).addEmbargo(this._owner.id()); + } + if (this._owner == this.target) { console.error(`Player ${this._owner} cannot attack itself`); this.active = false;