Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //argument0 = x
- //argument1 = resource
- xxxex = floor(argument0/40)
- switch(argument1)
- {
- case 4: bbb = 0
- break;
- case 1: bbb = 2
- break;
- case 2: bbb = 3
- break;
- case 3: bbb = 4
- break;
- }
- tttt = ds_list_create()
- for(xx = 0; xx < room_width/40+1; xx +=1;)
- {
- if global.terra[xx] = bbb
- {
- ds_list_add(tttt,xx)
- }
- }
- prev = ds_map_find_previous(tttt,xxxex)
- next = ds_map_find_next(tttt,xxxex)
- if !prev = 0
- and !next = 0
- {
- pp = ds_list_find_value(tttt,prev)
- pp = xxxex - pp
- nn = ds_list_find_value(tttt,next)
- nn = nn - xxxex
- if nn > pp
- {
- return ds_list_find_value(tttt,prev)*40
- }
- else
- {
- return ds_list_find_value(tttt,next)*40
- }
- }
- else
- if !prev = 0
- {
- return ds_list_find_value(tttt,prev)*40
- }
- else
- if !next = 0
- {
- return ds_list_find_value(tttt,next)*40
- }
- ds_list_destroy(tttt);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement