powergrid-viewer 1.11.2 → 1.11.3

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.11.2",
3
+ "version": "1.11.3",
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.15.2"
21
+ "powergrid-engine": "1.15.3"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/assert": "^1.4.7",
@@ -537,7 +537,6 @@ import Resources from './boards/Resources.vue';
537
537
  import { LogMove } from 'powergrid-engine/src/log';
538
538
  import { Phase, PowerPlant, PowerPlantType, ResourceType } from 'powergrid-engine/src/gamestate';
539
539
  import { City } from 'powergrid-engine/src/maps';
540
- import { countNetworks } from 'powergrid-engine/src/available-moves';
541
540
 
542
541
  @Component({
543
542
  created(this: Game) {
@@ -1119,8 +1118,15 @@ export default class Game extends Vue {
1119
1118
  const player = this.G?.players[playerIndex];
1120
1119
  if (!player) return false;
1121
1120
  if (player.usedFreeJump) return true;
1122
- if (player.cities.length >= 2) {
1123
- if (countNetworks(this.G!.map.connections, player.cities.map(c => c.name)) >= 2) return true;
1121
+ if (this.G?.log) {
1122
+ for (const entry of this.G.log) {
1123
+ if (entry.type === 'move' && (entry as any).player === playerIndex) {
1124
+ const move = (entry as any).move;
1125
+ if (move?.name === MoveName.Build && move?.data?.freeJump === true) {
1126
+ return true;
1127
+ }
1128
+ }
1129
+ }
1124
1130
  }
1125
1131
  return false;
1126
1132
  }