fix drop component
This commit is contained in:
parent
60bc30f01f
commit
0a79f672f3
@ -64,8 +64,12 @@ function on_sensor_enter(index, oid)
|
|||||||
local odrop = other:get_component("base:drop").dropitem
|
local odrop = other:get_component("base:drop").dropitem
|
||||||
if odrop.id == dropitem.id and not odrop.data then
|
if odrop.id == dropitem.id and not odrop.data then
|
||||||
local stack = item.stack_size(dropitem.id)
|
local stack = item.stack_size(dropitem.id)
|
||||||
local sum = dropitem.count + odrop.count
|
local sum = (dropitem.count or 0) + (odrop.count or 0)
|
||||||
if sum <= stack then
|
if sum == 0 then
|
||||||
|
dropitem:despawn();
|
||||||
|
odrop:despawn();
|
||||||
|
return
|
||||||
|
elseif sum <= stack then
|
||||||
dropitem.count = 0
|
dropitem.count = 0
|
||||||
odrop.count = sum
|
odrop.count = sum
|
||||||
entity:despawn()
|
entity:despawn()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user