use from_value
This commit is contained in:
parent
5ba9908b50
commit
85798c83a2
@ -205,8 +205,8 @@ impl SRankWeapon {
|
||||
|
||||
// TODO: return Result<SRankWeapon, SRankError>
|
||||
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]);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user