Skip to content

Commit

Permalink
chore: fix test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
justindujardin committed Oct 30, 2022
1 parent f6e78e9 commit 83de153
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/app/routes/combat/combat-map.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class CombatMapComponent
{
private _tileRenderer: TileMapRenderer = new TileMapRenderer();

@Input() scene: Scene;
@Input() scene: Scene | null;
@Input() combat: any; // _ TODO: This creates a nasty circular import situation

@ViewChild(CombatCameraBehaviorComponent)
Expand Down Expand Up @@ -98,7 +98,7 @@ export class CombatMapComponent
private _resourceSubscription: Subscription | null;

ngAfterViewInit(): void {
this.scene.addObject(this);
this.scene?.addObject(this);
this.addBehavior(this.camera);
// Whenever the underlying map resource changes, update party/enemy state from latest values.
this._resourceSubscription = this.resource$
Expand All @@ -122,7 +122,7 @@ export class CombatMapComponent

ngOnDestroy(): void {
this._resourceSubscription?.unsubscribe();
this.scene.removeObject(this);
this.scene?.removeObject(this);
this.removeBehavior(this.camera);
this.destroy();
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/scene/tile-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { SceneObject } from './scene-object';
export class TileMap extends SceneObject {
map: TiledTMXResource;
tiles: (TilesetTile | null)[] = [];
scene: Scene;
scene: Scene | null;
features?: ITiledLayer;
zones?: ITiledLayer;
bounds: Rect = new Rect(0, 0, 10, 10);
Expand Down

0 comments on commit 83de153

Please sign in to comment.