aboutsummaryrefslogtreecommitdiff
path: root/client/player/player.gd
diff options
context:
space:
mode:
authortpart <tpart120@proton.me>2025-09-27 20:41:51 +0200
committertpart <tpart120@proton.me>2025-09-27 20:41:51 +0200
commitd546a49927a50ef1dd6fcde3bd25f86cde51ebbb (patch)
tree6b5e21325249ee949acf401abdbe51766f235c96 /client/player/player.gd
parentf70da9c821387c43df2f2c009db1add439e940ec (diff)
downloadhurrycurry-d546a49927a50ef1dd6fcde3bd25f86cde51ebbb.tar
hurrycurry-d546a49927a50ef1dd6fcde3bd25f86cde51ebbb.tar.bz2
hurrycurry-d546a49927a50ef1dd6fcde3bd25f86cde51ebbb.tar.zst
Fix crash when item message is cleared
Diffstat (limited to 'client/player/player.gd')
-rw-r--r--client/player/player.gd11
1 files changed, 7 insertions, 4 deletions
diff --git a/client/player/player.gd b/client/player/player.gd
index c5ee0d89..94034352 100644
--- a/client/player/player.gd
+++ b/client/player/player.gd
@@ -192,8 +192,9 @@ func item_message(item_name: String, timeout_initial: float, timeout_remaining:
current_item_message = item_name
func clear_item_message():
- current_item_message = null
- item_bubble.queue_free()
+ if item_bubble != null:
+ current_item_message = null
+ item_bubble.queue_free()
func text_message(message: Game.TextMessage):
if chat_bubble != null:
@@ -204,7 +205,8 @@ func text_message(message: Game.TextMessage):
clear_chat_timer.start(message.timeout_remaining)
func clear_text_message():
- chat_bubble.queue_free()
+ if chat_bubble != null:
+ chat_bubble.queue_free()
func effect_message(effect_name: String):
if effect != null:
@@ -215,4 +217,5 @@ func effect_message(effect_name: String):
clear_effect_timer.start(5)
func clear_effect():
- effect.queue_free()
+ if effect != null:
+ effect.queue_free()