Fixes for DEAD event and extra nil checks

This commit is contained in:
Applevangelist
2022-05-04 10:25:50 +02:00
parent 6e8edd95ec
commit 8099847e29
8 changed files with 274 additions and 183 deletions

View File

@@ -1064,12 +1064,17 @@ do -- SET_GROUP
function SET_GROUP:AddGroup( group )
self:Add( group:GetName(), group )
-- I set the default cargo bay weight limit each time a new group is added to the set.
for UnitID, UnitData in pairs( group:GetUnits() ) do
UnitData:SetCargoBayWeightLimit()
if not DontSetCargoBayLimit then
-- I set the default cargo bay weight limit each time a new group is added to the set.
-- TODO Why is this here in the first place?
for UnitID, UnitData in pairs( group:GetUnits() ) do
if UnitData and UnitData:IsAlive() then
UnitData:SetCargoBayWeightLimit()
end
end
end
return self
end