fix: match surprise attack boundaries

This commit is contained in:
2026-07-26 09:36:44 +00:00
parent c364552960
commit d4d373c4bd
4 changed files with 336 additions and 10 deletions
+1 -4
View File
@@ -482,12 +482,9 @@ export class InMemoryTurnWorld {
}
getDiplomacyEntry(srcNationId: number, destNationId: number): TurnDiplomacy | null {
if (srcNationId === destNationId) {
return null;
}
const key = buildDiplomacyKey(srcNationId, destNationId);
let entry = this.diplomacy.get(key);
if (!entry && this.nations.has(srcNationId) && this.nations.has(destNationId)) {
if (!entry && srcNationId !== destNationId && this.nations.has(srcNationId) && this.nations.has(destNationId)) {
entry = buildDefaultDiplomacy(srcNationId, destNationId);
this.diplomacy.set(key, entry);
this.dirtyDiplomacyKeys.add(key);