fix(cafe): read PointCost as uint16 for G1-G5.2 clients

Cherry-picked from main (3d0114c) with conflict resolution.
Pre-G6 clients send PointCost as uint16, not uint32.
This commit is contained in:
Houmgaor
2026-01-30 01:10:34 +01:00
parent c4036daebc
commit e095c5a5ca

View File

@@ -4,6 +4,7 @@ import (
"errors"
"erupe-ce/common/byteframe"
_config "erupe-ce/config"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
@@ -30,7 +31,11 @@ func (m *MsgMhfAcquireCafeItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cl
m.ItemType = bf.ReadUint16()
m.ItemID = bf.ReadUint16()
m.Quant = bf.ReadUint16()
if _config.ErupeConfig.RealClientMode >= _config.G6 {
m.PointCost = bf.ReadUint32()
} else {
m.PointCost = uint32(bf.ReadUint16())
}
m.Unk0 = bf.ReadUint16()
return nil
}