powergrid-viewer 1.9.5 → 1.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "powergrid-viewer",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.6",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/boardgamers/powergrid.git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"vue": "^2.6.11",
|
|
19
19
|
"vue-class-component": "^7.2.3",
|
|
20
20
|
"vue-property-decorator": "^8.4.2",
|
|
21
|
-
"powergrid-engine": "1.13.
|
|
21
|
+
"powergrid-engine": "1.13.5"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/assert": "^1.4.7",
|
package/src/components/Game.vue
CHANGED
|
@@ -458,6 +458,7 @@ import Resources from './boards/Resources.vue';
|
|
|
458
458
|
import { LogMove } from 'powergrid-engine/src/log';
|
|
459
459
|
import { Phase, PowerPlant, PowerPlantType, ResourceType } from 'powergrid-engine/src/gamestate';
|
|
460
460
|
import { City } from 'powergrid-engine/src/maps';
|
|
461
|
+
import { countNetworks } from 'powergrid-engine/src/available-moves';
|
|
461
462
|
|
|
462
463
|
@Component({
|
|
463
464
|
created(this: Game) {
|
|
@@ -1036,7 +1037,16 @@ export default class Game extends Vue {
|
|
|
1036
1037
|
}
|
|
1037
1038
|
|
|
1038
1039
|
playerHasUsedFreeJump(playerIndex: number): boolean {
|
|
1039
|
-
|
|
1040
|
+
const player = this.G?.players[playerIndex];
|
|
1041
|
+
if (!player) return false;
|
|
1042
|
+
// Primary: trust the engine flag (set for all new games).
|
|
1043
|
+
if (player.usedFreeJump) return true;
|
|
1044
|
+
// Fallback: detect from network topology for game states where
|
|
1045
|
+
// usedFreeJump wasn't tracked (games started before that field existed).
|
|
1046
|
+
if (player.cities.length >= 2) {
|
|
1047
|
+
return countNetworks(this.G!.map.connections, player.cities.map(c => c.name)) >= 2;
|
|
1048
|
+
}
|
|
1049
|
+
return false;
|
|
1040
1050
|
}
|
|
1041
1051
|
|
|
1042
1052
|
canBuild(city: City) {
|