Prevented pet damage

This commit is contained in:
Joshua Barretto
2020-07-07 01:01:39 +01:00
parent f77d2f06c6
commit e626f6255f
14 changed files with 111 additions and 50 deletions

View File

@ -1,9 +1,9 @@
use crate::path::Chaser;
use specs::{Component, Entity as EcsEntity};
use crate::{path::Chaser, sync::Uid};
use specs::{Component, Entity as EcsEntity, FlaggedStorage};
use specs_idvs::IdvStorage;
use vek::*;
#[derive(Copy, Clone, Debug, PartialEq)]
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum Alignment {
/// Wild animals and gentle giants
Wild,
@ -14,7 +14,7 @@ pub enum Alignment {
/// Farm animals and pets of villagers
Tame,
/// Pets you've tamed with a collar
Owned(EcsEntity),
Owned(Uid),
}
impl Alignment {
@ -51,7 +51,7 @@ impl Alignment {
}
impl Component for Alignment {
type Storage = IdvStorage<Self>;
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
}
#[derive(Clone, Debug, Default)]