mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-19 04:06:43 -04:00
Retry setting primaries automatically, mainly to avoid confusion when creation was impossible due to lack of memory.
This commit is contained in:
parent
e04d497fe9
commit
137204dea1
@ -27,6 +27,12 @@ end
|
|||||||
|
|
||||||
function component.isAvailable(componentType)
|
function component.isAvailable(componentType)
|
||||||
checkArg(1, componentType, "string")
|
checkArg(1, componentType, "string")
|
||||||
|
if not primaries[componentType] then
|
||||||
|
-- This is mostly to avoid out of memory errors preventing proxy
|
||||||
|
-- creation cause confusion by trying to create the proxy again,
|
||||||
|
-- causing the oom error to be thrown again.
|
||||||
|
component.setPrimary(componentType, component.list(componentType)())
|
||||||
|
end
|
||||||
return primaries[componentType] ~= nil
|
return primaries[componentType] ~= nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user