added null check for witch and player for gameover screen highlight if fruits would drop on last frame

main
Artur 2026-06-03 17:10:37 +02:00
parent 965c6fb632
commit eeea6d2d59
1 changed files with 5 additions and 2 deletions

View File

@ -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