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
|
/// Escape hatch for runtime creation of loadout not covered by entity
|
||||||
/// config.
|
/// config.
|
||||||
|
// NOTE: Signature is part of interface of EntityInfo
|
||||||
pub fn get_adhoc_loadout(
|
pub fn get_adhoc_loadout(
|
||||||
&self,
|
&self,
|
||||||
) -> fn(LoadoutBuilder, Option<&trade::SiteInformation>) -> LoadoutBuilder {
|
) -> fn(LoadoutBuilder, Option<&trade::SiteInformation>) -> LoadoutBuilder {
|
||||||
|
@ -448,16 +448,18 @@ impl NpcData {
|
|||||||
let loadout = loadout_builder.build();
|
let loadout = loadout_builder.build();
|
||||||
let mut inventory = comp::inventory::Inventory::new_with_loadout(loadout);
|
let mut inventory = comp::inventory::Inventory::new_with_loadout(loadout);
|
||||||
for (num, mut item) in items {
|
for (num, mut item) in items {
|
||||||
tracing::warn!(
|
if let Err(e) = item.set_amount(num) {
|
||||||
"error during creating inventory for {name} at {pos}: {e:?}",
|
tracing::warn!(
|
||||||
name = &stats.name,
|
"error during creating inventory for {name} at {pos}: {e:?}",
|
||||||
e = item.set_amount(num)
|
name = &stats.name,
|
||||||
);
|
);
|
||||||
tracing::warn!(
|
}
|
||||||
"error during creating inventory for {name} at {pos}: {e:?}",
|
if let Err(e) = inventory.push(item) {
|
||||||
name = &stats.name,
|
tracing::warn!(
|
||||||
e = inventory.push(item)
|
"error during creating inventory for {name} at {pos}: {e:?}",
|
||||||
);
|
name = &stats.name,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inventory
|
inventory
|
||||||
|
Loading…
Reference in New Issue
Block a user