Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_room_tile_clear

(view raw script w/o annotations or w/e)
1
function room_tile_clear(argument0) //gml_Script_room_tile_clear
2
{
3
    var __ind = argument0
4
    if (room_exists(__ind) == false)
5
        return -1;
6
    var __currroom = layer_get_target_room()
7
    layer_set_target_room(__ind)
8
    var __layers = layer_get_all()
9
    var __numlayers = array_length_1d(__layers)
10
    for (var __i = 0; __i < __numlayers; __i++)
11
    {
12
        var __els = layer_get_all_elements(__layers[__i])
13
        var __numels = array_length_1d(__els)
14
        for (var __j = 0; __j < __numels; __j++)
15
        {
16
            var __eltype = layer_get_element_type(__els[__j])
17
            if (__eltype == 7)
18
                layer_tile_destroy(__els[__j])
19
        }
20
    }
21
    layer_set_target_room(__currroom)
22
}