From 86e90cfac9df3a7745d425ee88ba524b84b971cf Mon Sep 17 00:00:00 2001 From: AlKabir <7501421-frrleone@users.noreply.gitlab.com> Date: Thu, 29 Oct 2020 16:40:32 -0500 Subject: [PATCH] Make different mobs drop different assetts on death (not just lootbags) cargo fmt --- server/src/events/entity_manipulation.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index 3782bf73e2..553166751c 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -419,14 +419,11 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc let pos = state.ecs().read_storage::().get(entity).cloned(); if let Some(pos) = pos { let _ = state - .create_object( - comp::Pos(pos.0 + Vec3::unit_z() * 0.25), - match old_body{ - Some(common::comp::Body::Humanoid(_)) => object::Body::Pouch, - Some(common::comp::Body::Golem(_)) => object::Body::Chest, - _ => object::Body::Pumpkin, - }, - ) + .create_object(comp::Pos(pos.0 + Vec3::unit_z() * 0.25), match old_body { + Some(common::comp::Body::Humanoid(_)) => object::Body::Pouch, + Some(common::comp::Body::Golem(_)) => object::Body::Chest, + _ => object::Body::Pumpkin, + }) .with(item) .build(); } else {