adjustement

This commit is contained in:
guiyomu-dev
2026-02-14 21:10:31 +01:00
parent 285129e47e
commit 48aa3aee66
6 changed files with 39 additions and 24 deletions

View File

@@ -14,7 +14,6 @@ import (
)
func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, hover data.HoverData) data.Inventory {
item.SetExpChar(gd.ExpChar)
mainPlayer := rawPlayerUnits.GetMainPlayer()
baseAddr := gd.Process.moduleBaseAddressPtr + gd.offset.UnitTable + (4 * 1024)
unitTableBuffer := gd.Process.ReadBytesFromMemory(baseAddr, 128*8)
@@ -132,7 +131,7 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, hover data.HoverD
itm := &data.Item{
ID: int(txtFileNo),
UnitID: data.UnitID(unitID),
Name: item.GetNameByEnum(txtFileNo),
Name: item.GetNameByEnumWithExpChar(gd.ExpChar, txtFileNo),
Quality: item.Quality(itemQuality),
Position: data.Position{
X: int(itemX),

View File

@@ -7,6 +7,7 @@ import (
"github.com/hectorgimenez/d2go/pkg/data"
"github.com/hectorgimenez/d2go/pkg/data/area"
"github.com/hectorgimenez/d2go/pkg/data/game"
"github.com/hectorgimenez/d2go/pkg/data/skill"
"github.com/hectorgimenez/d2go/pkg/data/state"
)
@@ -40,7 +41,7 @@ func (gd *GameReader) GetRawPlayerUnits() RawPlayerUnits {
expChar := gd.Process.ReadUInt(expCharPtr+0x5C, Uint16)
gd.ExpChar = uint16(expChar)
isMainPlayer := gd.Process.ReadUInt(inventoryAddr+0x30, Uint16)
if expChar >= 2 {
if expChar >= uint(game.CharLoD) {
isMainPlayer = gd.Process.ReadUInt(inventoryAddr+0x70, Uint16)
}
isCorpse := gd.Process.ReadUInt(playerUnit+0x1AE, Uint8)