From b9c01d990fdf0dc08142ab17c4c859c6c43a08b1 Mon Sep 17 00:00:00 2001 From: Enrico Marconi Date: Fri, 9 Apr 2021 13:46:43 +0200 Subject: [PATCH] fix issue #1059: Debug items should disappear when dropped --- server/src/events/inventory_manip.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/src/events/inventory_manip.rs b/server/src/events/inventory_manip.rs index d922628c07..db5b245a6f 100644 --- a/server/src/events/inventory_manip.rs +++ b/server/src/events/inventory_manip.rs @@ -607,9 +607,11 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv } }, } - - // Drop items - for (pos, ori, item) in dropped_items { + // Drop items, Debug items should simply disappear when dropped + for (pos, ori, item) in dropped_items + .into_iter() + .filter(|(_, _, i)| !matches!(i.quality(), item::Quality::Debug)) + { // hack: special case coins for now let body = match item.item_definition_id() { "common.items.utility.coins" => comp::object::Body::Coins,