diff --git a/pkg/memory/terrorzones.go b/pkg/memory/terrorzones.go index 176ce0b..3c07607 100644 --- a/pkg/memory/terrorzones.go +++ b/pkg/memory/terrorzones.go @@ -5,20 +5,14 @@ import ( ) func (gd *GameReader) TerrorZones() (areas []area.ID) { - const maxActiveZoneCount = 16 - structPtr := gd.moduleBaseAddressPtr + gd.offset.TZ zonesPtr := uintptr(gd.ReadUInt(structPtr, Uint64)) actualActiveZoneCount := int(gd.ReadUInt(structPtr+0x8, Uint8)) - if zonesPtr == 0 || actualActiveZoneCount <= 0 || actualActiveZoneCount > maxActiveZoneCount { - return nil - } for i := 0; i < actualActiveZoneCount; i++ { tzArea := gd.ReadUInt(zonesPtr+uintptr(i*Uint32), Uint32) - id := area.ID(tzArea) - if id.CanBeTerrorized() { - areas = append(areas, id) + if tzArea != 0 { + areas = append(areas, area.ID(tzArea)) } }