Skip to content

Commit 6ce3ed2

Browse files
committed
Fix crashing after moving selection under all layers
1 parent 8c7a27b commit 6ce3ed2

File tree

7 files changed

+29
-0
lines changed

7 files changed

+29
-0
lines changed

Minecraft Note Block Studio.yyp

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/control_draw/control_draw.gml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ function control_draw() {
528528
selection_y = max(0, selection_y)
529529
history_set(h_selectmove, selection_x, selection_y, selection_sx, selection_sy)
530530
window = w_releasemouse
531+
selection_expand_layers()
531532
}
532533
}
533534
if (!isplayer) {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function selection_expand_layers(){
2+
if (selection_y + selection_h - 1 >= endb2) {
3+
for (i = endb2; i < selection_y + selection_h; i++) {
4+
layername[i] = ""
5+
layerlock[i] = 0
6+
layervol[i] = 100
7+
layerstereo[i] = 100
8+
rowamount[i] = 0
9+
endb2 = i + 1
10+
}
11+
}
12+
}

scripts/selection_expand_layers/selection_expand_layers.yy

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/selection_load/selection_load.gml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,5 @@ function selection_load(argument0, argument1, argument2, argument3) {
6363
selection_l = ca + 1
6464
selection_h = h + 1
6565
selection_code_update()
66+
selection_expand_layers()
6667
}

scripts/selection_load_ext/selection_load_ext.gml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,5 @@ function selection_load_ext(argument0, argument1, argument2) {
6363
selection_l = ca + 1
6464
selection_h = h + 1
6565
selection_code_update()
66+
selection_expand_layers()
6667
}

scripts/selection_load_from_array/selection_load_from_array.gml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ function selection_load_from_array(xx, yy, array){
3535
selection_l = ca + 1
3636
selection_h = h + 1
3737
selection_code_update()
38+
selection_expand_layers()
3839
}

0 commit comments

Comments
 (0)