From ce7586fa547e808ec2a63da0dc7aa73a0ae43cf6 Mon Sep 17 00:00:00 2001 From: gucio321 Date: Wed, 7 Apr 2021 17:24:00 +0200 Subject: [PATCH] d2ds1: fixed bug, when cullNilLayers worked incorrect --- d2common/d2fileformats/d2ds1/ds1_layers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/d2common/d2fileformats/d2ds1/ds1_layers.go b/d2common/d2fileformats/d2ds1/ds1_layers.go index 8589c144..f187a84c 100644 --- a/d2common/d2fileformats/d2ds1/ds1_layers.go +++ b/d2common/d2fileformats/d2ds1/ds1_layers.go @@ -81,9 +81,9 @@ func (l *ds1Layers) cullNilLayers(t LayerGroupType) { // exit culling procedure when no nil layers are found in entire group. culling: for { - for idx := len(*group) - 1; idx > 0; idx-- { + for idx := len(*group) - 1; idx >= 0; idx-- { if (*group)[idx] == nil { - *group = (*group)[:idx] + *group = append((*group)[:idx], (*group)[idx+1:]...) continue culling } }