diff --git a/server/src/rtsim/entity.rs b/server/src/rtsim/entity.rs index 97a268525d..e16c6f7cd3 100644 --- a/server/src/rtsim/entity.rs +++ b/server/src/rtsim/entity.rs @@ -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 { diff --git a/server/src/sys/terrain.rs b/server/src/sys/terrain.rs index 5bd71de438..d7b0c26ef9 100644 --- a/server/src/sys/terrain.rs +++ b/server/src/sys/terrain.rs @@ -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