- Added SPAWN:InitRandomizeZones() method.

- Renamed SPAWN:CleanUp() method to SPAWN:InitCleanUp() method.

- Reviewed documentation of the PatrolZone module and PATROLZONE class.

- Reviewed all test missions
This commit is contained in:
Sven Van de Velde
2016-08-16 10:17:35 +02:00
parent 0c15f92210
commit 3861362ed9
127 changed files with 56115 additions and 302 deletions

View File

@@ -547,19 +547,20 @@ end
function ZONE_UNIT:GetRandomVec2()
self:F( self.ZoneName )
local Point = {}
local PointVec2 = self.ZoneUNIT:GetPointVec2()
if not PointVec2 then
PointVec2 = self.LastVec2
local RandomVec2 = {}
local Vec2 = self.ZoneUNIT:GetVec2()
if not Vec2 then
Vec2 = self.LastVec2
end
local angle = math.random() * math.pi*2;
Point.x = PointVec2.x + math.cos( angle ) * math.random() * self:GetRadius();
Point.y = PointVec2.y + math.sin( angle ) * math.random() * self:GetRadius();
RandomVec2.x = Vec2.x + math.cos( angle ) * math.random() * self:GetRadius();
RandomVec2.y = Vec2.y + math.sin( angle ) * math.random() * self:GetRadius();
self:T( { Point } )
self:T( { RandomVec2 } )
return Point
return RandomVec2
end
--- Returns the @{DCSTypes#Vec3} of the ZONE_UNIT.