aboutsummaryrefslogtreecommitdiff
path: root/client/map/items/plate.gd
diff options
context:
space:
mode:
authortpart <tpart120@proton.me>2024-09-16 15:39:30 +0200
committertpart <tpart120@proton.me>2024-09-16 15:39:34 +0200
commit503e0c59f8eb6186dd21171b7aaa0127a8580588 (patch)
tree0c373f99abab809310ac6c19e2151fb5bab300aa /client/map/items/plate.gd
parentcf235a807dbde2e6c69598a524d87f70085fd774 (diff)
downloadhurrycurry-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.gd13
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")])