From f8ff92a84d103f8cbd1714c208b40a6fc8f642dd Mon Sep 17 00:00:00 2001 From: crumblingstatue Date: Sun, 16 Apr 2023 01:45:20 +0200 Subject: [PATCH] Log unsuccessful item give in console --- src/app.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app.rs b/src/app.rs index fd3297b..2357f3e 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1,3 +1,5 @@ +use std::fmt::Write; + use anyhow::Context; use directories::ProjectDirs; use egui_sfml::SfEgui; @@ -410,9 +412,15 @@ impl App { self.game.inventory.slots.push(Slot { id: i as ItemId, qty: 1, - }) + }); + return; } } + writeln!( + &mut self.debug.console.log, + "Item with name '{name}' not found" + ) + .unwrap(); } } }