mirror of
https://github.com/minetest-mods/drawers.git
synced 2024-11-21 22:23:44 +01:00
Fix drawer initialization bug; used wrong meta fields for 1x1 Drawers
This commit is contained in:
parent
768edb4d09
commit
03e692d72a
15
lua/api.lua
15
lua/api.lua
@ -48,13 +48,16 @@ function drawers.drawer_on_construct(pos)
|
||||
|
||||
i = 1
|
||||
while i <= drawerType do
|
||||
meta:set_string("name"..i, "")
|
||||
meta:set_int("count"..i, 0)
|
||||
meta:set_int("max_count"..i, base_stack_max * stack_max_factor)
|
||||
meta:set_int("base_stack_max"..i, base_stack_max)
|
||||
meta:set_string("entity_infotext"..i, drawers.gen_info_text("Empty", 0,
|
||||
local vid = i
|
||||
-- 1x1 drawers don't have numbers in the meta fields
|
||||
if drawerType == 1 then vid = "" end
|
||||
meta:set_string("name"..vid, "")
|
||||
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))
|
||||
meta:set_int("stack_max_factor"..i, stack_max_factor)
|
||||
meta:set_int("stack_max_factor"..vid, stack_max_factor)
|
||||
|
||||
i = i + 1
|
||||
end
|
||||
|
@ -91,7 +91,6 @@ core.register_entity("drawers:visual", {
|
||||
-- visual size
|
||||
local visual_size = {x = 0.6, y = 0.6}
|
||||
if self.drawerType >= 2 then
|
||||
core.chat_send_all("small")
|
||||
visual_size = {x = 0.3, y = 0.3}
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user