1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-20 06:05:23 +00:00

d2dat: fixed encoder bug (make(..., nonzero) and append later)

This commit is contained in:
M. Sz 2021-03-07 19:31:30 +01:00
parent fbd675c076
commit 7b77011977

View File

@ -26,7 +26,7 @@ func Load(data []byte) (d2interface.Palette, error) {
// Marshal encodes data palette back into byte slice
func (p *DATPalette) Marshal() []byte {
result := make([]byte, len(p.colors))
result := make([]byte, 0)
for _, i := range &p.colors {
result = append(result, i.B(), i.G(), i.R())