Coh3n
2011-03-08 18:21:07
Happened to me a couple times in my private fighter. It only breaks if Result := True, which doesn't always happen. Fix:
Function r_WebWalk(T: TTile): Boolean;
Var
I, T: Integer;
M, P: TPoint;
CTRLPoints: TPointArray;
Begin
P := TileToPoint(T);
T := (GetSystemTime + (5 * 60000));
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 or (GetSystemTime > T));
End;
You can change the 5 minutes to whatever you want.