diff --git a/src/newtypes/common.rs b/src/newtypes/common.rs index 0136b54..cec7e09 100644 --- a/src/newtypes/common.rs +++ b/src/newtypes/common.rs @@ -1,26 +1,3 @@ pub const fn flag(b:bool,mask:u8)->u8{ (-(b as i8) as u8)&mask } - -#[binrw::binrw] -#[brw(little,repr=u8)] -pub enum Boolio{ - True, - False -} -impl Into for Boolio{ - fn into(self)->bool{ - match self{ - Boolio::True=>true, - Boolio::False=>false, - } - } -} -impl From for Boolio{ - fn from(value:bool)->Self{ - match value{ - true=>Boolio::True, - false=>Boolio::False, - } - } -} diff --git a/src/newtypes/gameplay_attributes.rs b/src/newtypes/gameplay_attributes.rs index 6a758fb..3dcfb81 100644 --- a/src/newtypes/gameplay_attributes.rs +++ b/src/newtypes/gameplay_attributes.rs @@ -1,10 +1,12 @@ -use super::common::{flag,Boolio}; +use super::common::flag; use super::integer::{Time,Planar64,Planar64Vec3}; #[binrw::binrw] #[brw(little)] pub struct ContactingLadder{ - pub sticky:Boolio, + #[br(map=|paused:u8|paused!=0)] + #[bw(map=|paused:&bool|*paused as u8)] + pub sticky:bool, } impl Into for ContactingLadder{ fn into(self)->strafesnet_common::gameplay_attributes::ContactingLadder{