From ce4a35f32b4100236cd2865830ba80583274985e Mon Sep 17 00:00:00 2001 From: stone_tao Date: Sun, 19 Feb 2023 19:46:20 -0800 Subject: [PATCH] fix bug --- lux-eye-s2/package.json | 2 +- lux-eye-s2/src/episode/luxai-s2.ts | 2 +- lux-eye-s2/src/episode/model.ts | 2 +- lux-eye-s2/src/pages/visualizer/TurnControl.tsx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lux-eye-s2/package.json b/lux-eye-s2/package.json index 8ac5ffca..de6c35e6 100644 --- a/lux-eye-s2/package.json +++ b/lux-eye-s2/package.json @@ -1,6 +1,6 @@ { "name": "@lux-ai/lux-eye-s2", - "version": "2.1.8", + "version": "2.1.9", "type": "module", "scripts": { "dev": "vite", diff --git a/lux-eye-s2/src/episode/luxai-s2.ts b/lux-eye-s2/src/episode/luxai-s2.ts index bbf04e41..147ded0c 100644 --- a/lux-eye-s2/src/episode/luxai-s2.ts +++ b/lux-eye-s2/src/episode/luxai-s2.ts @@ -134,7 +134,7 @@ export function parseLuxAIS2Episode(data: any, extra: Partial = throw new Error('Only Lux AI v1.1.0+ episodes are supported'); } - let metadata: EpisodeMetadata = { teamNames: ['Player A', 'Player B'], seed: -1 }; + let metadata: EpisodeMetadata = { teamNames: ['Player A', 'Player B'], seed: undefined }; metadata = { ...metadata, ...extra, diff --git a/lux-eye-s2/src/episode/model.ts b/lux-eye-s2/src/episode/model.ts index db8789c9..c450ee49 100644 --- a/lux-eye-s2/src/episode/model.ts +++ b/lux-eye-s2/src/episode/model.ts @@ -170,5 +170,5 @@ export interface Episode { } export interface EpisodeMetadata { teamNames: [string, string]; - seed: number; + seed?: number; } diff --git a/lux-eye-s2/src/pages/visualizer/TurnControl.tsx b/lux-eye-s2/src/pages/visualizer/TurnControl.tsx index 0e266930..9e3ef0e1 100644 --- a/lux-eye-s2/src/pages/visualizer/TurnControl.tsx +++ b/lux-eye-s2/src/pages/visualizer/TurnControl.tsx @@ -287,7 +287,7 @@ export function TurnControl({ showHotkeysButton, showOpenButton }: TurnControlPr {isDay ? 'Day' : 'Night'} - Seed: {episode.metadata.seed} + {episode.metadata.seed && Seed: {episode.metadata.seed}} {selectedTile !== null && ( Tile: ({selectedTile.x}, {selectedTile.y})