Its Really Old Code, so i'm sure he will just laugh at it. Needs to just be rewritten anyways.
sub init
tile init nooverrides
set %x1 #charposx - 2
set %y1 #charposy - 2
set %x_limit #charposx + 2
set %y_limit #charposy + 2
return
sub tiler
Tile init Nooverrides
gosub Diagnostics Tile 0
Tiler:
set #lpc 100
tile cnt %x1 %y1
for %tilekind 1 #tilecnt
{
tile Init
tile get %x1 %y1 %tilekind
set %8x8_X %x1 / 8
set %8x8_Y %y1 / 8
set %8x8 %8x8_X , _ , %8x8_Y
if TREE in #tilename && %8x8 notin %last8x8
{
set %last8x8 %last8x8 , _ , %8x8
set %tree_found YES
set #ltargetx %x1
set #ltargety %y1
set #ltargettile #tiletype
Set #ltargetkind 3
set #ltargetz #tilez
set #lpc 20
set %chops 0
return
}
}
gosub Next_tile
if %y1 > %y_limit
{
gosub Diagnostics Notree 20
set %init True
set %tree_found No
set %y1 #charposy - 2
set #lpc 20
set %last8x8 N/A
return
}
goto tiler
sub Next_Tile
set %x1 %x1 + 1
if %x1 > %x_limit
{
set %y1 %y1 + 1
set %x1 #charposx - 2
}
return