From 10efa08dc69f9173dc04738aab96f01b00dcbc8a Mon Sep 17 00:00:00 2001 From: notoraptor Date: Fri, 26 Oct 2018 13:43:53 -0400 Subject: [python] Update SMALL_MAPS in convoy_paths with newly created maps. [web] Update npm packaqges requirements. [web] Fix province controller parsing. --- diplomacy/web/src/gui/diplomacy/utils/province.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'diplomacy/web/src') diff --git a/diplomacy/web/src/gui/diplomacy/utils/province.js b/diplomacy/web/src/gui/diplomacy/utils/province.js index fc48ac7..fe54a82 100644 --- a/diplomacy/web/src/gui/diplomacy/utils/province.js +++ b/diplomacy/web/src/gui/diplomacy/utils/province.js @@ -52,11 +52,11 @@ export class Province { setController(controller, controlType) { if (!['C', 'I', 'U'].includes(controlType)) throw new Error(`Invalid province control type (${controlType}), expected 'C', 'I' or 'U'.`); - if (this.controller) { + if (this.controller && this.controller !== controller) { const controlTypeComparison = this.compareControlType(controlType, this.controlType); if (controlTypeComparison === 0) - throw new Error(`Found 2 powers trying to control same province (${this.name}) with same ` + - `control type (${controlType} VS ${this.controlType}).`); + throw new Error(`Found 2 powers (${this.controller}, ${controller}) trying to control same province ` + + `(${this.name}) with same control type (${controlType} VS ${this.controlType}).`); if (controlTypeComparison > 0) this.__set_controller(controller, controlType); } else -- cgit v1.2.3