Apply suggestion

- Remove default value for CharacterAbility
- Put back accidentally removed comment
This commit is contained in:
Benoît du Garreau 2020-12-14 00:36:28 +01:00 committed by Marcel Märtens
parent ce9d706ed4
commit 1c4e334cd4
2 changed files with 5 additions and 11 deletions

View File

@ -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<Self, assets::Error> {
error!(
?err,
"Error loading CharacterAbility: {} for the ability map: replacing with default",
specifier
);
Ok(CharacterAbility::default())
}
}
impl CharacterAbility {

View File

@ -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 {