@@ -1385,13 +1385,13 @@ end
13851385 @return () -> Zone?
13861386]=]
13871387function Observer .iterZones (self : Types .InternalObserver ): () -> Types .Zone ?
1388- local zoneId : number
1388+ local zoneId : number ?
13891389 local attachedList : { number }
13901390 local observerId = self .id
13911391
13921392 return function (): Types .Zone ?
13931393 while true do
1394- zoneId , attachedList = next (zoneAttachedObservers :: any , zoneId )
1394+ zoneId , attachedList = next (zoneAttachedObservers , zoneId )
13951395
13961396 if not zoneId then
13971397 return nil
@@ -1417,13 +1417,13 @@ end
14171417 @return () -> Group?
14181418]=]
14191419function Observer .iterGroups (self : Types .InternalObserver ): () -> Types .Group ?
1420- local groupId : number
1420+ local groupId : number ?
14211421 local observersMap : { [number ]: boolean }
14221422 local observerId = self .id
14231423
14241424 return function (): Types .Group ?
14251425 while true do
1426- groupId , observersMap = next (State .groupToObservers :: any , groupId )
1426+ groupId , observersMap = next (State .groupToObservers , groupId )
14271427
14281428 if not groupId then
14291429 return nil
@@ -1433,7 +1433,7 @@ function Observer.iterGroups(self: Types.InternalObserver): () -> Types.Group?
14331433 continue
14341434 end
14351435
1436- local group = State .groups [groupId ]
1436+ local group = State .groups [groupId :: number ]
14371437 if group then
14381438 return group
14391439 end
@@ -1451,7 +1451,7 @@ end
14511451]=]
14521452function Observer .iterEntitiesInside (self : Types .InternalObserver ): () -> (any ? , Types .Zone ? )
14531453 local entities = (State .observerTrackingEntities [self .id ] or {}) :: { [Types .Entity ]: boolean }
1454- local entity : Types .Entity
1454+ local entity : Types .Entity ?
14551455 local observerId = self .id
14561456
14571457 return function ()
@@ -1461,7 +1461,7 @@ function Observer.iterEntitiesInside(self: Types.InternalObserver): () -> (any?,
14611461 return nil
14621462 end
14631463
1464- local data = State .entityData [entity ]
1464+ local data = State .entityData [entity :: Types . Entity ]
14651465 if not data then
14661466 continue
14671467 end
@@ -1471,7 +1471,7 @@ function Observer.iterEntitiesInside(self: Types.InternalObserver): () -> (any?,
14711471 continue
14721472 end
14731473
1474- local ref = State .entityToReference [entity ] or entity
1474+ local ref = State .entityToReference [entity :: Types . Entity ] or entity
14751475 return ref , State .zoneIdToZoneObj [zoneId ]
14761476 end
14771477 end
@@ -1487,7 +1487,7 @@ end
14871487]=]
14881488function Observer .iterPlayersInside (self : Types .InternalObserver ): () -> (Player ? , Types .Zone ? )
14891489 local entities = (State .observerTrackingEntities [self .id ] or {}) :: { [Types .Entity ]: boolean }
1490- local entity : Types .Entity
1490+ local entity : Types .Entity ?
14911491 local observerId = self .id
14921492
14931493 return function ()
@@ -1497,7 +1497,7 @@ function Observer.iterPlayersInside(self: Types.InternalObserver): () -> (Player
14971497 return nil , nil
14981498 end
14991499
1500- local data = State .entityData [entity ]
1500+ local data = State .entityData [entity :: Types . Entity ]
15011501 if not data then
15021502 continue
15031503 end
@@ -1507,7 +1507,7 @@ function Observer.iterPlayersInside(self: Types.InternalObserver): () -> (Player
15071507 continue
15081508 end
15091509
1510- local ref = State .entityToReference [entity ] or entity
1510+ local ref = State .entityToReference [entity :: Types . Entity ] or entity
15111511 if typeof (ref ) == 'Instance' and ref :IsA ('Player' ) then
15121512 return ref , State .zoneIdToZoneObj [zoneId ]
15131513 end
@@ -1532,7 +1532,7 @@ function Observer.iterEntitiesInZone(self: Types.InternalObserver, zone: Types.Z
15321532 end
15331533 end
15341534
1535- local entity : Types .Entity
1535+ local entity : Types .Entity ?
15361536 local targetZoneId = zone :getId ()
15371537 local observerId = self .id
15381538
@@ -1543,13 +1543,13 @@ function Observer.iterEntitiesInZone(self: Types.InternalObserver, zone: Types.Z
15431543 return nil
15441544 end
15451545
1546- local data = State .entityData [entity ]
1546+ local data = State .entityData [entity :: Types . Entity ]
15471547
15481548 if not data or data .activeObserverMemberships [observerId ] ~= targetZoneId then
15491549 continue
15501550 end
15511551
1552- return State .entityToReference [entity ] or entity
1552+ return State .entityToReference [entity :: Types . Entity ] or entity
15531553 end
15541554 end
15551555end
@@ -1571,7 +1571,7 @@ function Observer.iterPlayersInZone(self: Types.InternalObserver, zone: Types.Zo
15711571 end
15721572 end
15731573
1574- local entity : Types .Entity
1574+ local entity : Types .Entity ?
15751575 local targetZoneId = zone :getId ()
15761576 local observerId = self .id
15771577
@@ -1582,13 +1582,13 @@ function Observer.iterPlayersInZone(self: Types.InternalObserver, zone: Types.Zo
15821582 return nil
15831583 end
15841584
1585- local data = State .entityData [entity ]
1585+ local data = State .entityData [entity :: Types . Entity ]
15861586
15871587 if not data or data .activeObserverMemberships [observerId ] ~= targetZoneId then
15881588 continue
15891589 end
15901590
1591- local ref = State .entityToReference [entity ] or entity
1591+ local ref = State .entityToReference [entity :: Types . Entity ] or entity
15921592 if typeof (ref ) == 'Instance' and ref :IsA ('Player' ) then
15931593 return ref
15941594 end
0 commit comments