From 60ba9d5b87966d714c0c01f404d5a0b61c6a8b01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20du=20Garreau?= Date: Mon, 14 Dec 2020 00:36:28 +0100 Subject: [PATCH] Apply suggestion - Remove default value for CharacterAbility - Put back accidentally removed comment --- common/src/comp/ability.rs | 11 ----------- common/src/comp/inventory/item/mod.rs | 5 +++++ 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index b2375f04b7..f3b57ce606 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -17,7 +17,6 @@ use serde::{Deserialize, Serialize}; use specs::{Component, FlaggedStorage}; use specs_idvs::IdvStorage; use std::time::Duration; -use tracing::error; use vek::Vec3; #[derive(Copy, Clone, Hash, Eq, PartialEq, Debug, Serialize, Deserialize)] @@ -242,16 +241,6 @@ impl Asset for CharacterAbility { type Loader = assets::RonLoader; const EXTENSION: &'static str = "ron"; - - fn default_value(specifier: &str, err: assets::Error) -> Result { - error!( - ?err, - "Error loading CharacterAbility: {} for the ability map: replacing with default", - specifier - ); - - Ok(CharacterAbility::default()) - } } impl CharacterAbility { diff --git a/common/src/comp/inventory/item/mod.rs b/common/src/comp/inventory/item/mod.rs index 6dc1fdc87b..de3b26c707 100644 --- a/common/src/comp/inventory/item/mod.rs +++ b/common/src/comp/inventory/item/mod.rs @@ -171,6 +171,11 @@ impl assets::Compound for ItemDef { kind, quality, } = raw; + + // Some commands like /give_item provide the asset specifier separated with \ + // instead of . + // + // TODO: This probably does not belong here let item_definition_id = specifier.replace('\\', "."); Ok(ItemDef {