diff options
author | tpart <tpart120@proton.me> | 2024-09-16 15:39:30 +0200 |
---|---|---|
committer | tpart <tpart120@proton.me> | 2024-09-16 15:39:34 +0200 |
commit | 503e0c59f8eb6186dd21171b7aaa0127a8580588 (patch) | |
tree | 0c373f99abab809310ac6c19e2151fb5bab300aa /client/map/items/plate.gd | |
parent | cf235a807dbde2e6c69598a524d87f70085fd774 (diff) | |
download | hurrycurry-503e0c59f8eb6186dd21171b7aaa0127a8580588.tar hurrycurry-503e0c59f8eb6186dd21171b7aaa0127a8580588.tar.bz2 hurrycurry-503e0c59f8eb6186dd21171b7aaa0127a8580588.tar.zst |
Fix plate fills offset
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")]) |