Updates for Anapa. Fixed a bug in SPAWN (small bug)

This commit is contained in:
svenvandevelde 2016-05-06 14:21:24 +02:00
parent 4adf5aa188
commit bfeaa961f6
3 changed files with 11 additions and 4 deletions

View File

@ -345,6 +345,12 @@ function DATABASE:_RegisterGroup( GroupTemplate )
self.Groups[GroupTemplateName] = {} self.Groups[GroupTemplateName] = {}
self.Groups[GroupTemplateName].Status = nil self.Groups[GroupTemplateName].Status = nil
end end
-- Delete the spans from the route, it is not needed and takes memory.
if GroupTemplate.route and GroupTemplate.route.spans then
GroupTemplate.route.spans = nil
end
self.Groups[GroupTemplateName].GroupName = GroupTemplateName self.Groups[GroupTemplateName].GroupName = GroupTemplateName
self.Groups[GroupTemplateName].Template = GroupTemplate self.Groups[GroupTemplateName].Template = GroupTemplate
self.Groups[GroupTemplateName].groupId = GroupTemplate.groupId self.Groups[GroupTemplateName].groupId = GroupTemplate.groupId

View File

@ -589,6 +589,9 @@ function SPAWN:SpawnFromUnit( HostUnit, OuterRadius, InnerRadius, SpawnIndex )
if SpawnTemplate then if SpawnTemplate then
local UnitPoint = HostUnit:GetPointVec2() local UnitPoint = HostUnit:GetPointVec2()
self:T( { "Current point of ", self.SpawnTemplatePrefix, UnitPoint } )
--for PointID, Point in pairs( SpawnTemplate.route.points ) do --for PointID, Point in pairs( SpawnTemplate.route.points ) do
--Point.x = UnitPoint.x --Point.x = UnitPoint.x
--Point.y = UnitPoint.y --Point.y = UnitPoint.y
@ -596,9 +599,6 @@ function SPAWN:SpawnFromUnit( HostUnit, OuterRadius, InnerRadius, SpawnIndex )
--Point.alt_type = nil --Point.alt_type = nil
--end --end
SpawnTemplate.route.points = nil
SpawnTemplate.route.points = {}
SpawnTemplate.route.points[1] = {}
SpawnTemplate.route.points[1].x = UnitPoint.x SpawnTemplate.route.points[1].x = UnitPoint.x
SpawnTemplate.route.points[1].y = UnitPoint.y SpawnTemplate.route.points[1].y = UnitPoint.y
@ -1056,6 +1056,7 @@ function SPAWN:_RandomizeTemplate( SpawnIndex )
self.SpawnGroups[SpawnIndex].SpawnTemplate.route = routines.utils.deepCopy( self.SpawnTemplate.route ) self.SpawnGroups[SpawnIndex].SpawnTemplate.route = routines.utils.deepCopy( self.SpawnTemplate.route )
self.SpawnGroups[SpawnIndex].SpawnTemplate.x = self.SpawnTemplate.x self.SpawnGroups[SpawnIndex].SpawnTemplate.x = self.SpawnTemplate.x
self.SpawnGroups[SpawnIndex].SpawnTemplate.y = self.SpawnTemplate.y self.SpawnGroups[SpawnIndex].SpawnTemplate.y = self.SpawnTemplate.y
self.SpawnGroups[SpawnIndex].SpawnTemplate.start_time = self.SpawnTemplate.start_time
for UnitID = 1, #self.SpawnGroups[SpawnIndex].SpawnTemplate.units do for UnitID = 1, #self.SpawnGroups[SpawnIndex].SpawnTemplate.units do
self.SpawnGroups[SpawnIndex].SpawnTemplate.units[UnitID].heading = self.SpawnTemplate.units[1].heading self.SpawnGroups[SpawnIndex].SpawnTemplate.units[UnitID].heading = self.SpawnTemplate.units[1].heading
end end