Deltarune (Chapter 2) script viewer

← back to main script listing

gml_GlobalScript_scr_spellget

(view raw script w/o annotations or w/e)
1
function 
scr_spellget
scr_spellget

function
scr_spellget(arg0, arg1)
{ var __spellj = 0; var __openslot = -1; var __haveit = 0; for (__spellj = 0; __spellj < 12; __spellj++) { if (global.spell[arg0][__spellj] == arg1) __haveit = 1; if (__openslot == -1) { if (global.spell[arg0][__spellj] == 0) __openslot = __spellj; } } if (__openslot >= 0 && __haveit == 0) global.spell[arg0][__openslot] = arg1; }
(arg0, arg1)
2
{
3
    var __spellj = 0;
4
    var __openslot = -1;
5
    var __haveit = 0;
6
    for (__spellj = 0; __spellj < 12; __spellj++)
7
    {
8
        if (global.spell[arg0][__spellj] == arg1)
9
            __haveit = 1;
10
        if (__openslot == -1)
11
        {
12
            if (global.spell[arg0][__spellj] == 0)
13
                __openslot = __spellj;
14
        }
15
    }
16
    if (__openslot >= 0 && __haveit == 0)
17
        global.spell[arg0][__openslot] = arg1;
18
}