diff --git a/Moose Development/Moose/Core/Database.lua b/Moose Development/Moose/Core/Database.lua index 913ec4fe9..901723088 100644 --- a/Moose Development/Moose/Core/Database.lua +++ b/Moose Development/Moose/Core/Database.lua @@ -188,7 +188,10 @@ function DATABASE:AddStatic( DCSStaticName ) if not self.STATICS[DCSStaticName] then self.STATICS[DCSStaticName] = STATIC:Register( DCSStaticName ) + return self.STATICS[DCSStaticName] end + + return nil end diff --git a/Moose Development/Moose/Core/SpawnStatic.lua b/Moose Development/Moose/Core/SpawnStatic.lua index 334201e4c..a4d0036a4 100644 --- a/Moose Development/Moose/Core/SpawnStatic.lua +++ b/Moose Development/Moose/Core/SpawnStatic.lua @@ -183,8 +183,8 @@ function SPAWNSTATIC:SpawnFromPointVec2( PointVec2, Heading, NewName ) --R2.1 local Static = coalition.addStaticObject( CountryID, StaticTemplate ) self.SpawnIndex = self.SpawnIndex + 1 - - return Static + + return _DATABASE:AddStatic(Static:getName()) end return nil @@ -216,7 +216,7 @@ function SPAWNSTATIC:ReSpawn() local Static = coalition.addStaticObject( CountryID, StaticTemplate ) - return Static + return _DATABASE:AddStatic(Static:getName()) end return nil @@ -247,7 +247,7 @@ function SPAWNSTATIC:ReSpawnAt( Coordinate, Heading ) local Static = coalition.addStaticObject( CountryID, StaticTemplate ) - return Static + return _DATABASE:AddStatic(Static:getName()) end return nil @@ -265,6 +265,6 @@ function SPAWNSTATIC:SpawnFromZone( Zone, Heading, NewName ) --R2.1 local Static = self:SpawnFromPointVec2( Zone:GetPointVec2(), Heading, NewName ) - return Static + return _DATABASE:AddStatic(Static:getName()) end