From 7fa01b9e3c49b93800be806c093b93eac2df8523 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sun, 4 Aug 2024 17:32:46 +0200 Subject: [PATCH] #STATIC - added access to STORAGE object if set (cargo static types) --- Moose Development/Moose/Wrapper/Static.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Moose Development/Moose/Wrapper/Static.lua b/Moose Development/Moose/Wrapper/Static.lua index 916b78a84..6cf1f28e5 100644 --- a/Moose Development/Moose/Wrapper/Static.lua +++ b/Moose Development/Moose/Wrapper/Static.lua @@ -330,3 +330,12 @@ function STATIC:FindAllByMatching( Pattern ) return GroupsFound end + +--- Get the Wrapper.Storage#STORAGE object of an static if it is used as cargo and has been set up as storage object. +-- @param #STATIC self +-- @return Wrapper.Storage#STORAGE Storage or `nil` if not fund or set up. +function STATIC:GetStaticStorage() + local name = self:GetName() + local storage = STORAGE:NewFromStaticCargo(name) + return storage +end