Why does this work:
Simba Code:
function WalkTowardTile(T : TTile) : Boolean; //Note, its T : TTile, not var T : TTile
var
Ti, Me : TTile;
Tr, tx, ty : Integer;
begin
if not LoggedIn then
Exit;
Tr := 0;
Debug('Can''t find next tile. Trying to walk closer.');
while not TileOnMM(T) do
begin
Me := GetMe.Tile;
tx := (T.x - Me.x)/2 + Me.x;
ty := (T.y - Me.y)/2 + Me.y;
Ti := Tile(tx, ty);
if TileOnMM(Ti) then
WalkToTile(Ti, 3, 1)
else
T := Ti; //I reset the parameter T
if Tr > 5 then
begin
Result := False;
Exit;
end;
end;
Result := True;
end;
I want to know because I've been having problems with my miner & banker lately and I think this may be the issue. The script runs great for awhile, then crashes with a black SMART screen after awhile.
Can anyone explain to me what exactly is going on when this happens (resetting a parameter in a function like shown above)? I always thought it'd give a compiler error.