Home
2011-04-28 05:26:04
Hello, as some of you might have noticed that if r_WebWalk is called and your Currentposition is near your destination it will fail. Well this little modification will call first If tileOnMM then walk to Destination, if not it will start generating those Blind points.
Easy fix. But aren't them all :P
EDIT: Yes it can be make shorter mabey couple lines :P But does it really matter?
~Home
Easy fix. But aren't them all :P
function r_WebWalk(T: TTile): Boolean;
var
I: Integer;
M, P: TPoint;
CTRLPoints: TPointArray;
begin
P := TileToPoint(T);
if TileOnMM(P) then begin
WalkToTile(P, 0, 10)
Result := True;
Exit;
end
else
repeat
M := GetMyPos;
CtrlPoints := r_WindPath(M.x, M.y, P.X, P.Y, 5.0, 2.5, 0.0, 0.0, 4.5, 2.5);
for I := High(CtrlPoints) downto 0 do
if WalkToTile(Tile(CtrlPoints[i].x, CtrlPoints[i].y), 0, 10) then
begin
Result := I = High(CtrlPoints);
Break;
end;
until (Result);
end;
EDIT: Yes it can be make shorter mabey couple lines :P But does it really matter?
~Home