mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-02-09 01:56:47 -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
|
||||
)
|
||||
|
||||
const (
|
||||
layerWeaponClassLength = 4
|
||||
)
|
||||
|
||||
const (
|
||||
badCharacter = string(byte(0))
|
||||
)
|
||||
@ -192,11 +196,11 @@ func (c *COF) Marshal() []byte {
|
||||
|
||||
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++ {
|
||||
if j < len(s) {
|
||||
sw.PushBytes(s[j])
|
||||
for letter := 0; letter < layerWeaponClassLength; letter++ {
|
||||
if letter < len(weaponClassString) {
|
||||
sw.PushBytes(weaponClassString[letter])
|
||||
} else {
|
||||
sw.PushBytes(0)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user