From 634482fb73e7026571e1d8c1970844db34c06dc1 Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 5 Apr 2024 05:10:03 +0200 Subject: [PATCH] despawn chat on death --- src/chat.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/chat.rs b/src/chat.rs index 1d1c86b..853516c 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -101,11 +101,14 @@ pub fn handle_new_conversations( } // no existing chats yet, let's create a new one - commands.spawn(Chat { - id: id.to_string(), - label: label.to_string(), - timer: time.elapsed_seconds_f64(), - }); + commands.spawn(( + Chat { + id: id.to_string(), + label: label.to_string(), + timer: time.elapsed_seconds_f64(), + }, + world::DespawnOnPlayerDeath, + )); break; } }