Skip to content

Commit

Permalink
Fix access violation in create_schematic() (#11534)
Browse files Browse the repository at this point in the history
fixes #11533

Schematics saved from y locations greater than 0 would cause an access violation if layer probabilities were specified
  • Loading branch information
Treer committed Aug 16, 2021
1 parent b3b075e commit 963fbd1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/mapgen/mg_schematic.cpp
Expand Up @@ -598,8 +598,9 @@ void Schematic::applyProbabilities(v3s16 p0,
}

for (size_t i = 0; i != splist->size(); i++) {
s16 y = (*splist)[i].first - p0.Y;
slice_probs[y] = (*splist)[i].second;
s16 slice = (*splist)[i].first;
if (slice < size.Y)
slice_probs[slice] = (*splist)[i].second;
}
}

Expand Down

0 comments on commit 963fbd1

Please sign in to comment.