add terror zones (#2)

This commit is contained in:
Héctor Giménez
2023-10-09 15:17:46 +09:00
committed by GitHub
parent 51ec9e0dca
commit 6e77a6494d
3 changed files with 28 additions and 8 deletions

18
pkg/memory/terrorzones.go Normal file
View File

@@ -0,0 +1,18 @@
package memory
import (
"github.com/hectorgimenez/d2go/pkg/data/area"
)
func (gd *GameReader) TerrorZones() (areas []area.Area) {
tz := gd.moduleBaseAddressPtr + 0x299E2D8
for i := 0; i < 7; i++ {
tzArea := gd.ReadUInt(tz+uintptr(i*Uint32), Uint32)
if tzArea != 0 {
areas = append(areas, area.Area(tzArea))
}
}
return
}