diff options
Diffstat (limited to 'client/map/items/plate.gd')
-rw-r--r-- | client/map/items/plate.gd | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/client/map/items/plate.gd b/client/map/items/plate.gd index f8afba5a..6e154072 100644 --- a/client/map/items/plate.gd +++ b/client/map/items/plate.gd @@ -32,13 +32,14 @@ func _init(owned_by_: Node3D, contents: Array): for c in contents: var item: Item match c: - "curry": item = PlateFill.new(self, Color(.75, .45, .1)) - "tomato-soup": item = PlateFill.new(self, Color(1., .3, .2)) + "curry": add_child(PlateFill.new(self, Color(.75, .45, .1))) + "tomato-soup": add_child(PlateFill.new(self, Color(1., .3, .2))) _: item = ItemFactory.produce(c, base) - base.add_child(item) - item.position.y = height_sum - @warning_ignore("static_called_on_instance") - height_sum += item.height() + if item != null: + base.add_child(item) + item.position.y = height_sum + @warning_ignore("static_called_on_instance") + height_sum += item.height() func setup_sounds(): take_sound.setup([preload("res://map/items/sounds/plate_take.ogg")]) |