What are the new ways of getting request_slot_count?Removed LuaEntity::clear_request_slot(), get_request_slot() and set_request_slot() methods.
Removed LuaEntity::request_slot_count read.
How do i migrate get_request_slot and set_request_slot in my mod to 2.0?
My code is
Code: Select all
for i = 1, entity.request_slot_count do
local slot = entity.get_request_slot(i)
if slot ~= nil and slot.name == "alien-hyper-module-" .. storage.currentmodulelevel[forceName] - 1 then
entity.set_request_slot({ name = "alien-hyper-module-" .. storage.currentmodulelevel[forceName], count = slot.count }, i)
end
if settings.startup["alien-module-hyper-ammo-enabled"].value and slot ~= nil and slot.name == "alien-hyper-magazine-" .. storage.currentmodulelevel[forceName] - 1 then
entity.set_request_slot({ name = "alien-hyper-magazine-" .. storage.currentmodulelevel[forceName], count = slot.count }, i)
end
end