From 56601ab9ce44a03b18ef587a3fc12c853ff845cf Mon Sep 17 00:00:00 2001 From: guiyomu-dev <22749537+guiyomu-dev@users.noreply.github.com> Date: Fri, 17 Oct 2025 17:49:36 +0200 Subject: [PATCH] keep only actual tz zones --- pkg/memory/terrorzones.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/memory/terrorzones.go b/pkg/memory/terrorzones.go index f5bcf6d..4023857 100644 --- a/pkg/memory/terrorzones.go +++ b/pkg/memory/terrorzones.go @@ -5,10 +5,12 @@ import ( ) func (gd *GameReader) TerrorZones() (areas []area.ID) { - tzPtr := uintptr(gd.ReadUInt(gd.moduleBaseAddressPtr+tzOnline, Uint64)) + structPtr := gd.moduleBaseAddressPtr + tzOnline + zonesPtr := uintptr(gd.ReadUInt(structPtr, Uint64)) + actualActiveZoneCount := int(gd.ReadUInt(structPtr+0x8, Uint8)) - for i := 0; i < 8; i++ { - tzArea := gd.ReadUInt(tzPtr+uintptr(i*Uint32), Uint32) + for i := 0; i < actualActiveZoneCount; i++ { + tzArea := gd.ReadUInt(zonesPtr+uintptr(i*Uint32), Uint32) if tzArea != 0 { areas = append(areas, area.ID(tzArea)) }