mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Adress review №2
This commit is contained in:
parent
6ae25d5956
commit
ed593cd0cb
@ -135,6 +135,7 @@ impl Entity {
|
||||
|
||||
/// Escape hatch for runtime creation of loadout not covered by entity
|
||||
/// config.
|
||||
// NOTE: Signature is part of interface of EntityInfo
|
||||
pub fn get_adhoc_loadout(
|
||||
&self,
|
||||
) -> fn(LoadoutBuilder, Option<&trade::SiteInformation>) -> LoadoutBuilder {
|
||||
|
@ -448,16 +448,18 @@ impl NpcData {
|
||||
let loadout = loadout_builder.build();
|
||||
let mut inventory = comp::inventory::Inventory::new_with_loadout(loadout);
|
||||
for (num, mut item) in items {
|
||||
tracing::warn!(
|
||||
"error during creating inventory for {name} at {pos}: {e:?}",
|
||||
name = &stats.name,
|
||||
e = item.set_amount(num)
|
||||
);
|
||||
tracing::warn!(
|
||||
"error during creating inventory for {name} at {pos}: {e:?}",
|
||||
name = &stats.name,
|
||||
e = inventory.push(item)
|
||||
);
|
||||
if let Err(e) = item.set_amount(num) {
|
||||
tracing::warn!(
|
||||
"error during creating inventory for {name} at {pos}: {e:?}",
|
||||
name = &stats.name,
|
||||
);
|
||||
}
|
||||
if let Err(e) = inventory.push(item) {
|
||||
tracing::warn!(
|
||||
"error during creating inventory for {name} at {pos}: {e:?}",
|
||||
name = &stats.name,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
inventory
|
||||
|
Loading…
Reference in New Issue
Block a user