mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-02-09 18:17:07 -05:00
hotfix: d2cof encoder: removed magic number (len of weapon class)
This commit is contained in:
parent
8a15c0b074
commit
1010353071
@ -30,6 +30,10 @@ const (
|
|||||||
layerWeaponClass
|
layerWeaponClass
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
layerWeaponClassLength = 4
|
||||||
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
badCharacter = string(byte(0))
|
badCharacter = string(byte(0))
|
||||||
)
|
)
|
||||||
@ -192,11 +196,11 @@ func (c *COF) Marshal() []byte {
|
|||||||
|
|
||||||
sw.PushBytes(byte(c.CofLayers[i].DrawEffect))
|
sw.PushBytes(byte(c.CofLayers[i].DrawEffect))
|
||||||
|
|
||||||
s := c.CofLayers[i].WeaponClass.String()
|
weaponClassString := c.CofLayers[i].WeaponClass.String()
|
||||||
|
|
||||||
for j := 0; j < 4; j++ {
|
for letter := 0; letter < layerWeaponClassLength; letter++ {
|
||||||
if j < len(s) {
|
if letter < len(weaponClassString) {
|
||||||
sw.PushBytes(s[j])
|
sw.PushBytes(weaponClassString[letter])
|
||||||
} else {
|
} else {
|
||||||
sw.PushBytes(0)
|
sw.PushBytes(0)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user