Make different mobs drop different assetts on death (not just lootbags) cargo fmt

This commit is contained in:
AlKabir 2020-10-29 16:40:32 -05:00
parent 134c481408
commit 289126d9c8

View File

@ -433,14 +433,11 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc
let pos = state.ecs().read_storage::<comp::Pos>().get(entity).cloned(); let pos = state.ecs().read_storage::<comp::Pos>().get(entity).cloned();
if let Some(pos) = pos { if let Some(pos) = pos {
let _ = state let _ = state
.create_object( .create_object(comp::Pos(pos.0 + Vec3::unit_z() * 0.25), match old_body {
comp::Pos(pos.0 + Vec3::unit_z() * 0.25), Some(common::comp::Body::Humanoid(_)) => object::Body::Pouch,
match old_body{ Some(common::comp::Body::Golem(_)) => object::Body::Chest,
Some(common::comp::Body::Humanoid(_)) => object::Body::Pouch, _ => object::Body::Pumpkin,
Some(common::comp::Body::Golem(_)) => object::Body::Chest, })
_ => object::Body::Pumpkin,
},
)
.with(item) .with(item)
.build(); .build();
} else { } else {