@@ -26,11 +26,13 @@ import { OBJECT_NAME } from '../../utils/object';
2626import type Unit from '../Unit' ;
2727import type { IntersectionListener } from '../rendererModule/Intersection' ;
2828import CharacterUnitModule from '../unitModule/Character' ;
29- import TeleporterUnit from '../unit/Teleporter' ;
30- import type { UnitIdentifier } from '../Unit ' ;
29+ import type TeleporterUnit from '../unit/Teleporter' ;
30+ import type { UnitIdentifier } from '../../types/unit ' ;
3131import BedUnitModule from '../unitModule/Bed' ;
3232import ChairUnitModule from '../unitModule/Chair' ;
33- import { TELEPORTER_TYPE } from '../unitModule/Teleporter' ;
33+ import TeleporterUnitModule , {
34+ TELEPORTER_TYPE
35+ } from '../unitModule/Teleporter' ;
3436import BenchUnitModule from '../unitModule/Bench' ;
3537import SlotUnitModule from '../unitModule/Slot' ;
3638
@@ -156,11 +158,12 @@ export default class RoomAppModule extends AppModule<State, Observables> {
156158 } else if ( unit . getPosition ( ) . equals ( new Vector3 ( 0 , 0 , 0 ) ) ) {
157159 const entranceTeleporter = room . modules . units
158160 . getUnits ( )
159- . filter ( unit => unit instanceof TeleporterUnit )
161+ . filter ( unit => unit . hasModuleType ( TeleporterUnitModule ) )
160162 . find (
161163 teleporterUnit =>
162- teleporterUnit . modules . teleporter . state . type ==
163- TELEPORTER_TYPE . ENTRANCE
164+ teleporterUnit . getModuleByType < TeleporterUnitModule > (
165+ TeleporterUnitModule
166+ ) . state . type == TELEPORTER_TYPE . ENTRANCE
164167 ) as TeleporterUnit ;
165168
166169 unitTeleporter = entranceTeleporter ;
0 commit comments