From 85798c83a212d2cb316e8734551953a72caf5778 Mon Sep 17 00:00:00 2001 From: andy Date: Sun, 6 Sep 2020 02:20:27 -0300 Subject: [PATCH] use from_value --- src/entity/item/esweapon.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/entity/item/esweapon.rs b/src/entity/item/esweapon.rs index be38a8a..71d1e74 100644 --- a/src/entity/item/esweapon.rs +++ b/src/entity/item/esweapon.rs @@ -205,8 +205,8 @@ impl SRankWeapon { // TODO: return Result 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 name = SRankWeapon::name_from_bytes(bytes[6..12]);