From eeea6d2d59f997954788ab760587d89ad44680fb Mon Sep 17 00:00:00 2001 From: Artur <2123806@stud.th-mannheim.de> Date: Wed, 3 Jun 2026 17:10:37 +0200 Subject: [PATCH] added null check for witch and player for gameover screen highlight if fruits would drop on last frame --- scripts/DropsBase.gd | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/DropsBase.gd b/scripts/DropsBase.gd index 9c6a9aa..ed0b742 100644 --- a/scripts/DropsBase.gd +++ b/scripts/DropsBase.gd @@ -12,9 +12,12 @@ var _sfx_player: AudioStreamPlayer func _ready() -> void: body_entered.connect(_on_body_entered) - witch = get_node("/root/Game/Witch") + witch = get_node_or_null("/root/Game/Witch") + player = get_node_or_null("/root/Game/Player") + if witch == null or player == null: + queue_free() + return collected.connect(witch._on_collect) - player = get_node("/root/Game/Player") _sfx_player = AudioStreamPlayer.new() _sfx_player.stream = _collect_sfx _sfx_player.volume_db = -18