mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-25 12:01:06 +01:00
Allow age to override during initialization.
This commit is contained in:
parent
ccea673dcc
commit
bfff643ff4
1 changed files with 4 additions and 3 deletions
|
@ -277,9 +277,10 @@ function kelp.init_age(pos, age, pos_hash, meta)
|
|||
local meta = meta or mt_get_meta(pos)
|
||||
|
||||
local age = age
|
||||
if not meta:contains("mcl_ocean:kelp_age") then
|
||||
-- NOTE: age param can only replace initial age roll.
|
||||
age = age or kelp.roll_init_age()
|
||||
if age then
|
||||
kelp.store_age(age, pos, pos_hash)
|
||||
elseif not meta:contains("mcl_ocean:kelp_age") then
|
||||
age = kelp.roll_init_age()
|
||||
kelp.store_age(age, pos, pos_hash)
|
||||
else
|
||||
age = meta:get_int("mcl_ocean:kelp_age")
|
||||
|
|
Loading…
Reference in a new issue