Browse Source

use from_value

pbs
andy 4 years ago
parent
commit
85798c83a2
  1. 4
      src/entity/item/esweapon.rs

4
src/entity/item/esweapon.rs

@ -205,8 +205,8 @@ impl SRankWeapon {
// TODO: return Result<SRankWeapon, SRankError> // TODO: return Result<SRankWeapon, SRankError>
pub fn from_bytes(bytes: [u8; 16]) -> SRankWeapon { pub fn from_bytes(bytes: [u8; 16]) -> SRankWeapon {
let type = bytes[1];
let special = bytes[2];
let type = SrankType.from_value(bytes[1] - 0x70).unwrap();
let special = SrankSpecial.from_value(bytes[2]).unwrap();
let grind = bytes[3]; let grind = bytes[3];
let name = SRankWeapon::name_from_bytes(bytes[6..12]); let name = SRankWeapon::name_from_bytes(bytes[6..12]);

Loading…
Cancel
Save