Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_collision_line_first

(view raw script w/o annotations or w/e)
1
function collision_line_first(argument0, argument1, argument2, argument3, argument4, argument5, argument6) //gml_Script_collision_line_first
2
{
3
    var ox = argument0
4
    var oy = argument1
5
    var dx = argument2
6
    var dy = argument3
7
    var object = argument4
8
    var prec = argument5
9
    var notme = argument6
10
    var sx = dx - ox
11
    var sy = dy - oy
12
    var inst = collision_line(ox, oy, dx, dy, object, prec, notme)
13
    if (inst != -4)
14
    {
15
        while (abs(sx) >= 1 || abs(sy) >= 1)
16
        {
17
            sx /= 2
18
            sy /= 2
19
            var i = collision_line(ox, oy, dx, dy, object, prec, notme)
20
            if i
21
            {
22
                dx -= sx
23
                dy -= sy
24
                inst = i
25
            }
26
            else
27
            {
28
                dx += sx
29
                dy += sy
30
            }
31
        }
32
    }
33
    return inst;
34
}