SAIL - Sprawdzanie czy cel jest osiągalny

Wszelkie pytania na temat SAIL'a i modowania OW.
Avatar de Usuario
Serpent
Soldier level 10
Soldier level 10
Estonia
Mensajes: 4166
Registrado: Mar Jul 07, 2009 9:13 pm
Ubicación: Polska - EuroStan ZSRE
Contactar:

SAIL - Sprawdzanie czy cel jest osiągalny

Mensaje por Serpent »

Napisałem kodzik który sprawdza czy cel jest osiągalny. Jeśli tak to jednostka podąża w podane miejsce i funkcja zwraca TRUE, w przeciwnym razie funkcja zwraca FALSE.

Código: Seleccionar todo

//Destination Reachable Function by Serpent
Export unreachableList;
On DestinationUnreachable(unit) Do
begin
if not unit in unreachableList then
   unreachableList := Insert(unreachableList, unreachableList+1, unit);
end;

Export Function DestinationReachable(unit, x, y);
begin
if unit in unreachableList then
  unreachableList := unreachableList diff unit;

   ComMoveXY(unit, x, y);

   Wait(1);

if unit in unreachableList then
   result := false
    else
     result := true;
End;
Epickie teksty:
Marek1906: jak zrobic aby sail był zielony?
Kvantovy: Wszystko normalne, wszystko w koło było dziwne
Kvantovy:: To jest fajne, że to nie jest takie głupie
Kvantovy:: remove sos from kanapeczka
Kvantovy:: zdarzają się rzezy które sie filozofom nie śniły
Cenwen: problemem jest gejostwo
"Taki z niego fizyk jak ze mnie baletnica" - Profesor Scholtze o Kvantovym.
JAKBYŁ BYM CZECHEM TO BYM ROZŁOŻYŁ NAMIOT ~Kvanciak
Responder