Fix drawer initialization bug; used wrong meta fields for 1x1 Drawers

This commit is contained in:
LNJ 2017-04-05 12:32:41 +02:00
parent 768edb4d09
commit 03e692d72a
No known key found for this signature in database
GPG Key ID: 69268DBD835B6B0B
2 changed files with 9 additions and 7 deletions

@ -48,13 +48,16 @@ function drawers.drawer_on_construct(pos)
i = 1 i = 1
while i <= drawerType do while i <= drawerType do
meta:set_string("name"..i, "") local vid = i
meta:set_int("count"..i, 0) -- 1x1 drawers don't have numbers in the meta fields
meta:set_int("max_count"..i, base_stack_max * stack_max_factor) if drawerType == 1 then vid = "" end
meta:set_int("base_stack_max"..i, base_stack_max) meta:set_string("name"..vid, "")
meta:set_string("entity_infotext"..i, drawers.gen_info_text("Empty", 0, meta:set_int("count"..vid, 0)
meta:set_int("max_count"..vid, base_stack_max * stack_max_factor)
meta:set_int("base_stack_max"..vid, base_stack_max)
meta:set_string("entity_infotext"..vid, drawers.gen_info_text("Empty", 0,
stack_max_factor, base_stack_max)) stack_max_factor, base_stack_max))
meta:set_int("stack_max_factor"..i, stack_max_factor) meta:set_int("stack_max_factor"..vid, stack_max_factor)
i = i + 1 i = i + 1
end end

@ -91,7 +91,6 @@ core.register_entity("drawers:visual", {
-- visual size -- visual size
local visual_size = {x = 0.6, y = 0.6} local visual_size = {x = 0.6, y = 0.6}
if self.drawerType >= 2 then if self.drawerType >= 2 then
core.chat_send_all("small")
visual_size = {x = 0.3, y = 0.3} visual_size = {x = 0.3, y = 0.3}
end end