SAIL - GetDistUnitToSide

Gotowe kody SAIL'a, informacje na temat moddingu, itd.

Moderator: zoNE

Post Reply
User avatar

Topic author
zoNE
The Great Uniter & Site Administrator
The Great Uniter & Site Administrator
Posts: 1537
Joined: Fri Feb 17, 2006 3:44 pm
Location: Poland
Contact:

SAIL - GetDistUnitToSide

#1

Post by zoNE » Fri Oct 16, 2015 9:43 am

Serpent wrote:

Code: Select all

Export Function GetDistUnitToSide(unit, side);
var tmp, dist;
begin
tmp  := NearestUnitToUnit(FilterAllUnits([f_side, side]), unit);
dist := GetDistUnits(unit, tmp);

if dist >= 9999 then
   result := -1
    else
     result := dist;
End;
Funkcja zwraca odległość pomiędzy jednostką (unit) zadaną parametrem a daną stroną.

Jeżeli na mapie nie ma ani jednej jednostki danej strony to funkcja zwraca -1.
Author: Serpent
Topic: viewtopic.php?f=42&t=4517

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest