1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2025-02-02 22:57:04 -05:00

d2ds1: fixed bug, when cullNilLayers worked incorrect

This commit is contained in:
gucio321 2021-04-07 17:24:00 +02:00
parent 49e8e42596
commit ce7586fa54

View File

@ -81,9 +81,9 @@ func (l *ds1Layers) cullNilLayers(t LayerGroupType) {
// exit culling procedure when no nil layers are found in entire group. // exit culling procedure when no nil layers are found in entire group.
culling: culling:
for { for {
for idx := len(*group) - 1; idx > 0; idx-- { for idx := len(*group) - 1; idx >= 0; idx-- {
if (*group)[idx] == nil { if (*group)[idx] == nil {
*group = (*group)[:idx] *group = append((*group)[:idx], (*group)[idx+1:]...)
continue culling continue culling
} }
} }