mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-07-30 06:48:24 +00:00
Update CTLD.lua
Fixing error when the savefile loads statics in the onafterLoad, it blows up. attempt to call method 'GetStaticResourceMap' (a nil value)
This commit is contained in:
@@ -9238,8 +9238,12 @@ end
|
||||
elseif cargotype == CTLD_CARGO.Enum.STATIC or cargotype == CTLD_CARGO.Enum.REPAIR then
|
||||
injectstatic = CTLD_CARGO:New(nil,cargoname,cargotemplates,cargotype,true,true,size,nil,true,mass)
|
||||
injectstatic:SetStaticTypeAndShape(StaticCategory,StaticType,StaticShape)
|
||||
local map=cargotype:GetStaticResourceMap()
|
||||
injectstatic:SetStaticResourceMap(map)
|
||||
local unittemplate = _DATABASE:GetStaticUnitTemplate(cargoname)
|
||||
local ResourceMap = nil
|
||||
if unittemplate and unittemplate.resourcePayload then
|
||||
ResourceMap = UTILS.DeepCopy(unittemplate.resourcePayload)
|
||||
end
|
||||
injectstatic:SetStaticResourceMap(ResourceMap)
|
||||
end
|
||||
if injectstatic then
|
||||
self:InjectStatics(dropzone,injectstatic,false,true)
|
||||
|
||||
Reference in New Issue
Block a user