Browse Source

Merge pull request 'armour_bytes' (#142) from armour_bytes into master

pbs
jake 5 years ago
parent
commit
51e7ab0c45
  1. 5
      src/entity/item/armor.rs
  2. 4
      src/entity/item/shield.rs

5
src/entity/item/armor.rs

@ -200,8 +200,9 @@ impl Armor {
pub fn as_bytes(&self) -> [u8; 16] { pub fn as_bytes(&self) -> [u8; 16] {
let mut result = [0; 16]; let mut result = [0; 16];
result[0..3].copy_from_slice(&self.armor.value()); result[0..3].copy_from_slice(&self.armor.value());
// TODO: other attrs
result[5] = self.slots;
result[6] = self.dfp;
result[8] = self.evp;
result result
} }
} }

4
src/entity/item/shield.rs

@ -353,8 +353,8 @@ impl Shield {
pub fn as_bytes(&self) -> [u8; 16] { pub fn as_bytes(&self) -> [u8; 16] {
let mut result = [0; 16]; let mut result = [0; 16];
result[0..3].copy_from_slice(&self.shield.value()); result[0..3].copy_from_slice(&self.shield.value());
// TODO: other attrs
result[6] = self.dfp;
result[8] = self.evp;
result result
} }
} }
Loading…
Cancel
Save