diff --git a/src/data/entity/css.rs b/src/data/entity/css.rs index fae35a4..157872e 100644 --- a/src/data/entity/css.rs +++ b/src/data/entity/css.rs @@ -26,7 +26,8 @@ pub enum Entity<'a> { #[serde(borrow)] EnvFireTrail(EnvFireTrail<'a>), #[serde(rename = "env_fog_controller")] - EnvFogController(EnvFogController), + #[serde(borrow)] + EnvFogController(EnvFogController<'a>), #[serde(rename = "env_hudhint")] #[serde(borrow)] EnvHudhint(EnvHudhint<'a>), @@ -66,7 +67,8 @@ pub enum Entity<'a> { #[serde(borrow)] EnvSun(EnvSun<'a>), #[serde(rename = "env_tonemap_controller")] - EnvTonemapController(EnvTonemapController), + #[serde(borrow)] + EnvTonemapController(EnvTonemapController<'a>), #[serde(rename = "env_wind")] EnvWind(EnvWind), #[serde(rename = "filter_activator_class")] @@ -136,7 +138,8 @@ pub enum Entity<'a> { #[serde(borrow)] FuncWaterAnalog(FuncWaterAnalog<'a>), #[serde(rename = "game_player_equip")] - GamePlayerEquip(GamePlayerEquip), + #[serde(borrow)] + GamePlayerEquip(GamePlayerEquip<'a>), #[serde(rename = "game_ui")] #[serde(borrow)] GameUi(GameUi<'a>), @@ -145,10 +148,10 @@ pub enum Entity<'a> { GameWeaponManager(GameWeaponManager<'a>), #[serde(rename = "info_ladder")] InfoLadder(InfoLadder), + #[serde(rename = "info_player_counterterrorist")] + InfoPlayerCounterterrorist(InfoPlayerCounterterrorist), #[serde(rename = "info_player_start")] InfoPlayerStart(InfoPlayerStart), - #[serde(rename = "info_player_counterterrorist")] - CounterTerroristSpawn(CounterTerroristSpawn), #[serde(rename = "info_player_terrorist")] InfoPlayerTerrorist(InfoPlayerTerrorist), #[serde(rename = "info_target")] @@ -166,8 +169,7 @@ pub enum Entity<'a> { #[serde(rename = "light")] Light(Light), #[serde(rename = "light_environment")] - #[serde(borrow)] - LightEnvironment(LightEnvironment<'a>), + LightEnvironment(LightEnvironment), #[serde(rename = "logic_auto")] #[serde(borrow)] LogicAuto(LogicAuto<'a>), @@ -275,7 +277,7 @@ pub enum Entity<'a> { #[serde(borrow)] WeaponFlashbang(WeaponFlashbang<'a>), #[serde(rename = "weapon_g3sg1")] - WeaponG3Sg1(WeaponG3Sg1), + WeaponG3sg1(WeaponG3sg1), #[serde(rename = "weapon_glock")] #[serde(borrow)] WeaponGlock(WeaponGlock<'a>), @@ -292,7 +294,8 @@ pub enum Entity<'a> { #[serde(borrow)] WeaponM3(WeaponM3<'a>), #[serde(rename = "weapon_m4a1")] - WeaponM4A1(WeaponM4A1), + #[serde(borrow)] + WeaponM4a1(WeaponM4a1<'a>), #[serde(rename = "weapon_mac10")] WeaponMac10(WeaponMac10), #[serde(rename = "weapon_p90")] @@ -314,48 +317,44 @@ pub enum Entity<'a> { #[serde(borrow)] WeaponUsp(WeaponUsp<'a>), #[serde(rename = "weapon_xm1014")] - WeaponXm1014(WeaponXm1014), + #[serde(borrow)] + WeaponXm1014(WeaponXm1014<'a>), #[serde(rename = "worldspawn")] #[serde(borrow)] Worldspawn(Worldspawn<'a>), } - -#[derive(Debug, Clone, Deserialize)] -pub struct CounterTerroristSpawn { - pub angles: Angles, - pub origin: Vector, -} #[derive(Debug, Clone, Deserialize)] pub struct EnvBeam<'a> { - pub boltwidth: f32, + pub boltwidth: u8, pub decalname: &'a str, pub hdrcolorscale: f32, pub life: f32, pub lightningend: &'a str, pub lightningstart: &'a str, - pub noiseamplitude: f32, + pub noiseamplitude: u8, pub origin: Vector, - pub radius: f32, + pub radius: u16, pub renderamt: u8, pub rendercolor: Color, - pub spawnflags: u32, - pub striketime: f32, + pub spawnflags: u8, + #[serde(deserialize_with = "bool_from_int")] + pub striketime: bool, pub targetname: &'a str, pub texture: &'a str, - pub texturescroll: f32, + pub texturescroll: u8, } #[derive(Debug, Clone, Deserialize)] pub struct EnvDetailController { - pub angles: Vector, - pub fademaxdist: f32, - pub fademindist: f32, + pub angles: Angles, + pub fademaxdist: u16, + pub fademindist: u8, pub origin: Vector, } #[derive(Debug, Clone, Deserialize)] pub struct EnvEmbers<'a> { - pub angles: Vector, - pub density: f32, - pub lifetime: f32, + pub angles: Angles, + pub density: u8, + pub lifetime: u8, pub model: &'a str, pub rendercolor: Color, pub spawnflags: u32, @@ -363,15 +362,20 @@ pub struct EnvEmbers<'a> { } #[derive(Debug, Clone, Deserialize)] pub struct EnvEntityMaker<'a> { - pub angles: Vector, + pub angles: Angles, pub entitytemplate: &'a str, + pub onentityspawned: &'a str, pub origin: Vector, - pub postspawndirection: Vector, + pub postspawndirection: Color, pub postspawndirectionvariance: f32, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub postspawninheritangles: bool, - pub postspawnspeed: f32, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub postspawnspeed: bool, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] @@ -381,21 +385,23 @@ pub struct EnvFade<'a> { pub origin: Vector, pub renderamt: u8, pub rendercolor: Color, - pub spawnflags: u32, + pub spawnflags: u8, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct EnvFire { pub damagescale: f32, pub fireattack: u8, - pub firesize: f32, + pub firesize: u8, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub firetype: bool, pub health: u8, - pub ignitionpoint: f32, + pub ignitionpoint: u8, pub origin: Vector, - pub spawnflags: u32, + pub spawnflags: u8, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub startdisabled: bool, } #[derive(Debug, Clone, Deserialize)] @@ -405,9 +411,9 @@ pub struct EnvFireTrail<'a> { pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] -pub struct EnvFogController { - pub angles: Vector, - pub farz: f32, +pub struct EnvFogController<'a> { + pub angles: Angles, + pub farz: i32, #[serde(deserialize_with = "bool_from_int")] pub fogblend: bool, pub fogcolor: Color, @@ -416,13 +422,19 @@ pub struct EnvFogController { #[serde(deserialize_with = "bool_from_int")] pub fogenable: bool, pub fogend: f32, - pub foglerptime: f32, + #[serde(default)] + pub foglerptime: Option, pub fogmaxdensity: f32, pub fogstart: f32, - pub maxdxlevel: u8, - pub mindxlevel: u8, + #[serde(deserialize_with = "bool_from_int")] + pub maxdxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + pub mindxlevel: bool, pub origin: Vector, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, + #[serde(default)] + pub targetname: Option<&'a str>, #[serde(deserialize_with = "bool_from_int")] pub use_angles: bool, } @@ -430,57 +442,68 @@ pub struct EnvFogController { pub struct EnvHudhint<'a> { pub message: &'a str, pub origin: Vector, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub spawnflags: bool, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct EnvLaser<'a> { - pub damage: i32, + #[serde(deserialize_with = "bool_from_int")] + pub damage: bool, pub dissolvetype: &'a str, pub lasertarget: &'a str, + #[serde(default)] + pub noiseamplitude: Option, pub origin: Vector, pub renderamt: u8, pub rendercolor: Color, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, pub texture: &'a str, - pub texturescroll: f32, - pub width: f32, + pub texturescroll: u8, + pub width: u8, } #[derive(Debug, Clone, Deserialize)] pub struct EnvLightglow { - pub angles: Vector, - pub glowproxysize: f32, + pub angles: Angles, + #[serde(deserialize_with = "bool_from_int")] + pub glowproxysize: bool, pub hdrcolorscale: f32, - pub horizontalglowsize: f32, - pub maxdist: f32, - pub mindist: f32, + pub horizontalglowsize: u8, + pub maxdist: u16, + pub mindist: u8, pub origin: Vector, - pub outermaxdist: f32, + #[serde(deserialize_with = "bool_from_int")] + pub outermaxdist: bool, pub rendercolor: Color, - pub spawnflags: u32, - pub verticalglowsize: f32, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, + pub verticalglowsize: u8, } #[derive(Debug, Clone, Deserialize)] pub struct EnvShake<'a> { - pub amplitude: f32, - pub duration: f32, + pub amplitude: u8, + pub duration: u8, pub frequency: f32, pub origin: Vector, - pub radius: f32, - pub spawnflags: u32, + pub radius: u16, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct EnvShooter<'a> { - pub angles: Vector, - pub delay: f32, + pub angles: Angles, + pub delay: u8, #[serde(deserialize_with = "bool_from_int")] pub disablereceiveshadows: bool, - pub gibangles: Vector, - pub gibgravityscale: f32, + pub gibangles: Color, + #[serde(deserialize_with = "bool_from_int")] + pub gibgravityscale: bool, pub m_flgiblife: f32, pub m_flvariance: f32, - pub m_flvelocity: f32, + pub m_flvelocity: u16, pub m_igibs: u32, #[serde(deserialize_with = "bool_from_int")] pub massoverride: bool, @@ -492,47 +515,64 @@ pub struct EnvShooter<'a> { pub rendercolor: Color, #[serde(deserialize_with = "bool_from_int")] pub renderfx: bool, - pub rendermode: u32, + #[serde(deserialize_with = "bool_from_int")] + pub rendermode: bool, pub shootmodel: &'a str, - pub shootsounds: i8, + pub shootsounds: i32, #[serde(deserialize_with = "bool_from_int")] pub simulation: bool, - pub skin: u16, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub skin: bool, + pub spawnflags: u8, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct EnvSmokestack<'a> { - pub angles: Vector, - pub basespread: f32, - pub endsize: f32, - pub initialstate: u8, - pub jetlength: f32, + pub angles: Angles, + pub basespread: u8, + pub endsize: u8, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub initialstate: bool, + pub jetlength: u8, pub origin: Vector, - pub rate: f32, + pub rate: u8, pub renderamt: u8, pub rendercolor: Color, - pub roll: f32, + #[serde(default)] + pub roll: Option, pub smokematerial: &'a str, - pub speed: f32, - pub spreadspeed: f32, - pub startsize: f32, - pub twist: f32, - pub windangle: f32, - pub windspeed: f32, + pub speed: u8, + pub spreadspeed: u8, + pub startsize: u8, + #[serde(default)] + pub targetname: Option<&'a str>, + #[serde(default)] + pub twist: Option, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub windangle: bool, + #[serde(default)] + pub windspeed: Option, } #[derive(Debug, Clone, Deserialize)] pub struct EnvSoundscape<'a> { pub origin: Vector, + #[serde(default)] + pub position1: Option<&'a str>, + #[serde(default)] + pub position2: Option<&'a str>, pub radius: f32, pub soundscape: &'a str, #[serde(deserialize_with = "bool_from_int")] pub startdisabled: bool, + #[serde(default)] + pub targetname: Option<&'a str>, } #[derive(Debug, Clone, Deserialize)] pub struct EnvSoundscapeTriggerable<'a> { pub origin: Vector, - pub radius: f32, + pub radius: u16, pub soundscape: &'a str, #[serde(deserialize_with = "bool_from_int")] pub startdisabled: bool, @@ -540,108 +580,146 @@ pub struct EnvSoundscapeTriggerable<'a> { } #[derive(Debug, Clone, Deserialize)] pub struct EnvSpark<'a> { - pub angles: Vector, - pub magnitude: f32, - pub maxdelay: f32, + pub angles: Angles, + pub magnitude: u8, + pub maxdelay: u8, pub origin: Vector, - pub spawnflags: u32, - pub targetname: &'a str, - pub traillength: f32, + pub spawnflags: u8, + #[serde(default)] + pub targetname: Option<&'a str>, + pub traillength: u8, } #[derive(Debug, Clone, Deserialize)] pub struct EnvSprite<'a> { #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub disablereceiveshadows: bool, pub framerate: f32, pub glowproxysize: f32, pub hdrcolorscale: f32, - pub maxdxlevel: u8, - pub mindxlevel: u8, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub maxdxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub mindxlevel: bool, pub model: &'a str, pub origin: Vector, + #[serde(default)] + pub parentname: Option<&'a str>, pub renderamt: u8, pub rendercolor: Color, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub renderfx: bool, - pub rendermode: u32, - pub spawnflags: u32, + pub rendermode: u8, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, + #[serde(default)] + pub targetname: Option<&'a str>, } #[derive(Debug, Clone, Deserialize)] pub struct EnvSpritetrail<'a> { pub endwidth: f32, pub lifetime: f32, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub maxdxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub mindxlevel: bool, pub origin: Vector, - pub parentname: &'a str, + #[serde(default)] + pub parentname: Option<&'a str>, pub renderamt: u8, pub rendercolor: Color, - pub rendermode: u32, + pub rendermode: u8, pub spritename: &'a str, pub startwidth: f32, + #[serde(default)] + pub targetname: Option<&'a str>, } #[derive(Debug, Clone, Deserialize)] pub struct EnvSteam<'a> { - pub angles: Vector, - pub endsize: f32, - pub jetlength: f32, + pub angles: Angles, + pub endsize: u8, + pub jetlength: u16, pub origin: Vector, - pub rate: f32, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub r#type: bool, + pub rate: u8, pub renderamt: u8, pub rendercolor: Color, - pub rollspeed: f32, - pub spawnflags: u32, - pub speed: f32, - pub spreadspeed: f32, - pub startsize: f32, + pub rollspeed: u8, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, + pub speed: u8, + pub spreadspeed: u8, + pub startsize: u8, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct EnvSun<'a> { - pub angles: Vector, + pub angles: Angles, pub hdrcolorscale: f32, pub material: &'a str, pub origin: Vector, pub overlaycolor: Color, pub overlaymaterial: &'a str, pub overlaysize: i32, + #[serde(default)] + pub pitch: Option, pub rendercolor: Color, - pub size: f32, - pub target: &'a str, + pub size: u8, + #[serde(default)] + pub target: Option<&'a str>, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub use_angles: bool, } #[derive(Debug, Clone, Deserialize)] -pub struct EnvTonemapController { +pub struct EnvTonemapController<'a> { pub origin: Vector, + #[serde(default)] + pub targetname: Option<&'a str>, } #[derive(Debug, Clone, Deserialize)] pub struct EnvWind { - pub angles: Vector, - pub gustdirchange: f32, - pub gustduration: f32, - pub maxgust: f32, - pub maxgustdelay: f32, - pub maxwind: f32, - pub mingust: f32, - pub mingustdelay: f32, - pub minwind: f32, + pub angles: Angles, + pub gustdirchange: u8, + pub gustduration: u8, + pub maxgust: u8, + pub maxgustdelay: u8, + pub maxwind: u8, + pub mingust: u8, + pub mingustdelay: u8, + pub minwind: u8, pub origin: Vector, } #[derive(Debug, Clone, Deserialize)] pub struct FilterActivatorClass<'a> { pub filterclass: &'a str, - pub negated: Negated, + pub negated: &'a str, pub origin: Vector, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct FilterActivatorName<'a> { pub filtername: &'a str, - pub negated: Negated, + pub negated: &'a str, + #[serde(default)] + pub onfail: Option<&'a str>, + #[serde(default)] + pub onpass: Option<&'a str>, pub origin: Vector, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct FilterDamageType<'a> { - pub damagetype: u32, - pub negated: Negated, + pub damagetype: u8, + #[serde(deserialize_with = "bool_from_int")] + pub negated: bool, pub origin: Vector, pub targetname: &'a str, } @@ -649,79 +727,125 @@ pub struct FilterDamageType<'a> { pub struct FilterMulti<'a> { pub filter01: &'a str, pub filter02: &'a str, + #[serde(default)] + pub filter03: Option<&'a str>, + #[serde(default)] + pub filter04: Option<&'a str>, + #[serde(default)] + pub filter05: Option<&'a str>, #[serde(deserialize_with = "bool_from_int")] pub filtertype: bool, - pub negated: Negated, + #[serde(deserialize_with = "bool_from_int")] + pub negated: bool, pub origin: Vector, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct FuncAreaportalwindow<'a> { - pub fadedist: f32, - pub fadestartdist: f32, - pub portalnumber: u16, - pub portalversion: u8, + pub fadedist: u16, + pub fadestartdist: u16, + pub portalnumber: u8, + #[serde(deserialize_with = "bool_from_int")] + pub portalversion: bool, pub target: &'a str, pub translucencylimit: f32, } #[derive(Debug, Clone, Deserialize)] pub struct FuncBreakable<'a> { + #[serde(default)] + pub _minlight: Option, #[serde(deserialize_with = "bool_from_int")] pub disablereceiveshadows: bool, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub disableshadows: bool, - pub explodedamage: u8, - pub explodemagnitude: f32, - pub exploderadius: f32, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub explodedamage: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub explodemagnitude: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub exploderadius: bool, #[serde(deserialize_with = "bool_from_int")] pub explosion: bool, - pub gibdir: Vector, - pub health: u8, - pub material: u32, - pub minhealthdmg: u8, + pub gibdir: Color, + pub health: u16, + pub material: u8, + #[serde(deserialize_with = "bool_from_int")] + pub minhealthdmg: bool, pub model: &'a str, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub nodamageforces: bool, pub origin: Vector, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub performancemode: bool, pub physdamagescale: f32, #[serde(deserialize_with = "bool_from_int")] pub pressuredelay: bool, - pub propdata: u32, + #[serde(deserialize_with = "bool_from_int")] + pub propdata: bool, pub renderamt: u8, pub rendercolor: Color, #[serde(deserialize_with = "bool_from_int")] pub renderfx: bool, - pub rendermode: u32, - pub spawnflags: u32, #[serde(deserialize_with = "bool_from_int")] + pub rendermode: bool, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub spawnobject: bool, + #[serde(default)] + pub targetname: Option<&'a str>, } #[derive(Debug, Clone, Deserialize)] pub struct FuncButton<'a> { + #[serde(default)] + pub _minlight: Option, + #[serde(default)] + pub angles: Option, #[serde(deserialize_with = "bool_from_int")] pub disablereceiveshadows: bool, - pub health: u8, #[serde(deserialize_with = "bool_from_int")] - pub lip: bool, + #[serde(default)] + pub disableshadows: bool, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub health: bool, + pub lip: f32, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub locked_sentence: bool, #[serde(deserialize_with = "bool_from_int")] pub locked_sound: bool, pub model: &'a str, - pub movedir: Vector, + pub movedir: Color, + #[serde(default)] + pub ondamaged: Option<&'a str>, + #[serde(default)] + pub onin: Option<&'a str>, + #[serde(default)] + pub onout: Option<&'a str>, pub onpressed: &'a str, pub origin: Vector, + #[serde(default)] + pub parentname: Option<&'a str>, pub renderamt: u8, pub rendercolor: Color, #[serde(deserialize_with = "bool_from_int")] pub renderfx: bool, - pub rendermode: u32, - pub sounds: u32, - pub spawnflags: u32, + pub rendermode: u8, + pub sounds: u8, + pub spawnflags: u16, pub speed: f32, + #[serde(default)] + pub targetname: Option<&'a str>, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub unlocked_sentence: bool, #[serde(deserialize_with = "bool_from_int")] pub unlocked_sound: bool, @@ -734,33 +858,37 @@ pub struct FuncBuyzone<'a> { } #[derive(Debug, Clone, Deserialize)] pub struct FuncConveyor<'a> { - pub angles: Vector, + pub angles: Angles, #[serde(deserialize_with = "bool_from_int")] pub disablereceiveshadows: bool, #[serde(deserialize_with = "bool_from_int")] pub disableshadows: bool, pub model: &'a str, - pub movedir: Vector, + pub movedir: Color, pub renderamt: u8, pub rendercolor: Color, #[serde(deserialize_with = "bool_from_int")] pub renderfx: bool, - pub rendermode: u32, - pub spawnflags: u32, - pub speed: f32, + #[serde(deserialize_with = "bool_from_int")] + pub rendermode: bool, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, + pub speed: u16, } #[derive(Debug, Clone, Deserialize)] pub struct FuncDoorRotating<'a> { - pub angles: Vector, + pub angles: Angles, #[serde(deserialize_with = "bool_from_int")] pub disablereceiveshadows: bool, #[serde(deserialize_with = "bool_from_int")] pub disableshadows: bool, - pub distance: f32, - pub dmg: i32, + pub distance: u8, + #[serde(deserialize_with = "bool_from_int")] + pub dmg: bool, #[serde(deserialize_with = "bool_from_int")] pub forceclosed: bool, - pub health: u8, + #[serde(deserialize_with = "bool_from_int")] + pub health: bool, #[serde(deserialize_with = "bool_from_int")] pub ignoredebris: bool, #[serde(deserialize_with = "bool_from_int")] @@ -775,76 +903,93 @@ pub struct FuncDoorRotating<'a> { pub rendercolor: Color, #[serde(deserialize_with = "bool_from_int")] pub renderfx: bool, - pub rendermode: u32, + #[serde(deserialize_with = "bool_from_int")] + pub rendermode: bool, #[serde(deserialize_with = "bool_from_int")] pub solidbsp: bool, - pub spawnflags: u32, + pub spawnflags: u16, #[serde(deserialize_with = "bool_from_int")] pub spawnpos: bool, - pub speed: f32, - pub targetname: &'a str, + pub speed: u8, + #[serde(default)] + pub targetname: Option<&'a str>, #[serde(deserialize_with = "bool_from_int")] pub unlocked_sentence: bool, - pub wait: f32, + pub wait: i32, } #[derive(Debug, Clone, Deserialize)] pub struct FuncDustcloud<'a> { pub alpha: u8, pub color: Color, - pub distmax: f32, + pub distmax: u16, #[serde(deserialize_with = "bool_from_int")] pub frozen: bool, - pub lifetimemax: f32, - pub lifetimemin: f32, + pub lifetimemax: u8, + pub lifetimemin: u8, pub model: &'a str, - pub sizemax: f32, - pub sizemin: f32, - pub spawnrate: f32, - pub speedmax: f32, + pub sizemax: u8, + pub sizemin: u8, + pub spawnrate: u16, + pub speedmax: u8, #[serde(deserialize_with = "bool_from_int")] pub startdisabled: bool, } #[derive(Debug, Clone, Deserialize)] pub struct FuncMovelinear<'a> { - #[serde(deserialize_with = "bool_from_int")] - pub blockdamage: bool, + pub blockdamage: f32, #[serde(deserialize_with = "bool_from_int")] pub disablereceiveshadows: bool, pub model: &'a str, pub movedir: Vector, - pub movedistance: f32, + pub movedistance: u16, + #[serde(default)] + pub onfullyclosed: Option<&'a str>, + #[serde(default)] + pub onfullyopen: Option<&'a str>, pub origin: Vector, - pub parentname: &'a str, + #[serde(default)] + pub parentname: Option<&'a str>, pub renderamt: u8, pub rendercolor: Color, #[serde(deserialize_with = "bool_from_int")] pub renderfx: bool, - pub rendermode: u32, - pub spawnflags: u32, - pub speed: f32, - #[serde(deserialize_with = "bool_from_int")] - pub startposition: bool, + pub rendermode: u8, + pub spawnflags: u8, + pub speed: u8, + pub startposition: f32, + #[serde(default)] + pub startsound: Option<&'a str>, + #[serde(default)] + pub stopsound: Option<&'a str>, + #[serde(default)] + pub targetname: Option<&'a str>, } #[derive(Debug, Clone, Deserialize)] pub struct FuncPhysbox<'a> { #[serde(deserialize_with = "bool_from_int")] pub damagetoenablemotion: bool, - pub damagetype: u32, + #[serde(deserialize_with = "bool_from_int")] + pub damagetype: bool, #[serde(deserialize_with = "bool_from_int")] pub disablereceiveshadows: bool, #[serde(deserialize_with = "bool_from_int")] pub disableshadows: bool, - pub explodedamage: u8, - pub explodemagnitude: f32, - pub exploderadius: f32, + #[serde(deserialize_with = "bool_from_int")] + pub explodedamage: bool, + #[serde(deserialize_with = "bool_from_int")] + pub explodemagnitude: bool, + #[serde(deserialize_with = "bool_from_int")] + pub exploderadius: bool, #[serde(deserialize_with = "bool_from_int")] pub explosion: bool, #[serde(deserialize_with = "bool_from_int")] pub forcetoenablemotion: bool, - pub gibdir: Vector, - pub health: u8, - pub massscale: f32, - pub material: u32, + pub gibdir: Color, + #[serde(deserialize_with = "bool_from_int")] + pub health: bool, + #[serde(deserialize_with = "bool_from_int")] + pub massscale: bool, + pub material: u8, pub model: &'a str, #[serde(deserialize_with = "bool_from_int")] pub nodamageforces: bool, @@ -854,40 +999,48 @@ pub struct FuncPhysbox<'a> { pub parentname: &'a str, #[serde(deserialize_with = "bool_from_int")] pub performancemode: bool, - pub preferredcarryangles: Angles, + pub preferredcarryangles: Color, #[serde(deserialize_with = "bool_from_int")] pub pressuredelay: bool, - pub propdata: u32, + #[serde(deserialize_with = "bool_from_int")] + pub propdata: bool, pub renderamt: u8, pub rendercolor: Color, #[serde(deserialize_with = "bool_from_int")] pub renderfx: bool, - pub rendermode: u32, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub rendermode: bool, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, #[serde(deserialize_with = "bool_from_int")] pub spawnobject: bool, } #[derive(Debug, Clone, Deserialize)] pub struct FuncPhysboxMultiplayer<'a> { - pub _minlight: f32, + pub _minlight: u8, #[serde(deserialize_with = "bool_from_int")] pub damagetoenablemotion: bool, - pub damagetype: u32, + #[serde(deserialize_with = "bool_from_int")] + pub damagetype: bool, #[serde(deserialize_with = "bool_from_int")] pub disablereceiveshadows: bool, #[serde(deserialize_with = "bool_from_int")] pub disableshadows: bool, - pub explodedamage: u8, - pub explodemagnitude: f32, - pub exploderadius: f32, + #[serde(deserialize_with = "bool_from_int")] + pub explodedamage: bool, + #[serde(deserialize_with = "bool_from_int")] + pub explodemagnitude: bool, + #[serde(deserialize_with = "bool_from_int")] + pub exploderadius: bool, #[serde(deserialize_with = "bool_from_int")] pub explosion: bool, #[serde(deserialize_with = "bool_from_int")] pub forcetoenablemotion: bool, - pub gibdir: Vector, - pub health: u8, + pub gibdir: Color, + #[serde(deserialize_with = "bool_from_int")] + pub health: bool, pub massscale: f32, - pub material: u32, + pub material: u8, pub model: &'a str, #[serde(deserialize_with = "bool_from_int")] pub nodamageforces: bool, @@ -896,15 +1049,17 @@ pub struct FuncPhysboxMultiplayer<'a> { pub origin: Vector, #[serde(deserialize_with = "bool_from_int")] pub performancemode: bool, - pub preferredcarryangles: Angles, + pub preferredcarryangles: Color, #[serde(deserialize_with = "bool_from_int")] pub pressuredelay: bool, - pub propdata: u32, + #[serde(deserialize_with = "bool_from_int")] + pub propdata: bool, pub renderamt: u8, pub rendercolor: Color, #[serde(deserialize_with = "bool_from_int")] pub renderfx: bool, - pub rendermode: u32, + #[serde(deserialize_with = "bool_from_int")] + pub rendermode: bool, pub spawnflags: u32, #[serde(deserialize_with = "bool_from_int")] pub spawnobject: bool, @@ -919,73 +1074,85 @@ pub struct FuncPrecipitation<'a> { } #[derive(Debug, Clone, Deserialize)] pub struct FuncRotButton<'a> { - pub angles: Vector, - pub distance: f32, - pub health: u8, + pub angles: Angles, + pub distance: u8, + #[serde(deserialize_with = "bool_from_int")] + pub health: bool, pub model: &'a str, pub onpressed: &'a str, pub origin: Vector, - pub sounds: u32, - pub spawnflags: u32, - pub speed: f32, + pub sounds: u8, + pub spawnflags: u16, + pub speed: u8, #[serde(deserialize_with = "bool_from_int")] pub startdisabled: bool, pub targetname: &'a str, - pub wait: f32, + pub wait: u8, } #[derive(Debug, Clone, Deserialize)] pub struct FuncRotating<'a> { - pub angles: Vector, + #[serde(default)] + pub _minlight: Option, + pub angles: Angles, #[serde(deserialize_with = "bool_from_int")] pub disablereceiveshadows: bool, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub disableshadows: bool, - pub dmg: i32, - #[serde(deserialize_with = "bool_from_int")] - pub fanfriction: bool, + pub dmg: f32, + pub fanfriction: f32, pub maxspeed: f32, pub model: &'a str, pub origin: Vector, - pub parentname: &'a str, + #[serde(default)] + pub parentname: Option<&'a str>, pub renderamt: u8, pub rendercolor: Color, #[serde(deserialize_with = "bool_from_int")] pub renderfx: bool, - pub rendermode: u32, + pub rendermode: u8, #[serde(deserialize_with = "bool_from_int")] pub solidbsp: bool, - pub spawnflags: u32, - pub volume: u8, + pub spawnflags: u16, + #[serde(default)] + pub targetname: Option<&'a str>, + pub volume: f32, } #[derive(Debug, Clone, Deserialize)] pub struct FuncSmokevolume<'a> { pub color1: Color, pub color2: Color, pub density: f32, - pub densityrampspeed: f32, + #[serde(deserialize_with = "bool_from_int")] + pub densityrampspeed: bool, pub material: &'a str, pub model: &'a str, - pub movementspeed: f32, - pub particledrawwidth: f32, - pub particlespacingdistance: f32, - pub rotationspeed: f32, - pub spawnflags: u32, + pub movementspeed: u8, + pub particledrawwidth: u8, + pub particlespacingdistance: u8, + pub rotationspeed: u8, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, } #[derive(Debug, Clone, Deserialize)] pub struct FuncTracktrain<'a> { - pub bank: i16, + #[serde(deserialize_with = "bool_from_int")] + pub bank: bool, #[serde(deserialize_with = "bool_from_int")] pub disablereceiveshadows: bool, #[serde(deserialize_with = "bool_from_int")] pub disableshadows: bool, - pub dmg: i32, - pub height: f32, + #[serde(deserialize_with = "bool_from_int")] + pub dmg: bool, + pub height: u8, pub model: &'a str, pub movesound: &'a str, pub movesoundmaxpitch: u8, - pub movesoundmaxtime: f32, + #[serde(deserialize_with = "bool_from_int")] + pub movesoundmaxtime: bool, pub movesoundminpitch: u8, - pub movesoundmintime: f32, + #[serde(deserialize_with = "bool_from_int")] + pub movesoundmintime: bool, #[serde(deserialize_with = "bool_from_int")] pub orientationtype: bool, pub origin: Vector, @@ -993,10 +1160,11 @@ pub struct FuncTracktrain<'a> { pub rendercolor: Color, #[serde(deserialize_with = "bool_from_int")] pub renderfx: bool, - pub rendermode: u32, - pub spawnflags: u32, - pub speed: f32, - pub startspeed: f32, + #[serde(deserialize_with = "bool_from_int")] + pub rendermode: bool, + pub spawnflags: u16, + pub speed: u16, + pub startspeed: u16, pub target: &'a str, pub targetname: &'a str, #[serde(deserialize_with = "bool_from_int")] @@ -1015,10 +1183,13 @@ pub struct FuncWall<'a> { pub rendercolor: Color, #[serde(deserialize_with = "bool_from_int")] pub renderfx: bool, - pub rendermode: u32, + pub rendermode: u8, } #[derive(Debug, Clone, Deserialize)] pub struct FuncWallToggle<'a> { + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub _minlight: bool, #[serde(deserialize_with = "bool_from_int")] pub disablereceiveshadows: bool, #[serde(deserialize_with = "bool_from_int")] @@ -1026,36 +1197,68 @@ pub struct FuncWallToggle<'a> { pub model: &'a str, pub renderamt: u8, pub rendercolor: Color, + pub renderfx: u8, + pub rendermode: u8, #[serde(deserialize_with = "bool_from_int")] - pub renderfx: bool, - pub rendermode: u32, - pub spawnflags: u32, + pub spawnflags: bool, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct FuncWaterAnalog<'a> { - pub _minlight: f32, + #[serde(default)] + pub _minlight: Option, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub disablereceiveshadows: bool, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub disableshadows: bool, pub model: &'a str, - pub movedir: Vector, - pub movedistance: f32, + pub movedir: Color, + pub movedistance: u8, pub origin: Vector, - pub renderamt: u8, - pub rendercolor: Color, + #[serde(default)] + pub parentname: Option<&'a str>, + #[serde(default)] + pub renderamt: Option, + #[serde(default)] + pub rendercolor: Option, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub renderfx: bool, - pub rendermode: u32, - pub speed: f32, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub rendermode: bool, + pub speed: u8, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub startposition: bool, pub waveheight: f32, } #[derive(Debug, Clone, Deserialize)] -pub struct GamePlayerEquip { +pub struct GamePlayerEquip<'a> { + #[serde(default)] + pub item_assaultsuit: Option, pub origin: Vector, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub spawnflags: bool, + #[serde(default)] + pub targetname: Option<&'a str>, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub weapon_awp: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub weapon_glock: bool, + #[serde(deserialize_with = "bool_from_int")] pub weapon_knife: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub weapon_p90: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub weapon_usp: bool, } #[derive(Debug, Clone, Deserialize)] pub struct GameUi<'a> { @@ -1066,7 +1269,7 @@ pub struct GameUi<'a> { pub pressedforward: &'a str, pub pressedmoveleft: &'a str, pub pressedmoveright: &'a str, - pub spawnflags: u32, + pub spawnflags: u16, pub targetname: &'a str, pub unpressedback: &'a str, pub unpressedforward: &'a str, @@ -1077,7 +1280,8 @@ pub struct GameUi<'a> { pub struct GameWeaponManager<'a> { #[serde(deserialize_with = "bool_from_int")] pub ammomod: bool, - pub maxpieces: u8, + #[serde(deserialize_with = "bool_from_int")] + pub maxpieces: bool, pub origin: Vector, pub weaponname: &'a str, } @@ -1097,51 +1301,65 @@ pub struct InfoLadder { pub mins_z: f32, } #[derive(Debug, Clone, Deserialize)] -pub struct InfoPlayerStart { - pub angles: Vector, +pub struct InfoPlayerCounterterrorist { + pub angles: Angles, pub origin: Vector, - pub spawnflags: u32, +} +#[derive(Debug, Clone, Deserialize)] +pub struct InfoPlayerStart { + pub angles: Angles, + pub origin: Vector, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, } #[derive(Debug, Clone, Deserialize)] pub struct InfoPlayerTerrorist { - pub angles: Vector, + pub angles: Angles, pub origin: Vector, } #[derive(Debug, Clone, Deserialize)] pub struct InfoTarget<'a> { - pub angles: Vector, + pub angles: Angles, pub origin: Vector, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub spawnflags: bool, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct InfoTeleportDestination<'a> { - pub angles: Vector, + pub angles: Angles, pub origin: Vector, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct Infodecal<'a> { - pub angles: Vector, + #[serde(default)] + pub angles: Option, pub origin: Vector, pub texture: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct KeyframeRope<'a> { - pub angles: Vector, - pub movespeed: f32, + pub angles: Angles, + pub movespeed: u8, + #[serde(default)] + pub nextkey: Option<&'a str>, pub origin: Vector, + #[serde(default)] + pub parentname: Option<&'a str>, pub ropematerial: &'a str, - pub slack: f32, + pub slack: u8, pub subdiv: u8, pub targetname: &'a str, - pub texturescale: f32, - pub width: f32, + #[serde(deserialize_with = "bool_from_int")] + pub texturescale: bool, + pub width: u8, } #[derive(Debug, Clone, Deserialize)] pub struct Light { pub _light: Color, - pub _lighthdr: LightColor, + pub _lighthdr: Vector, #[serde(deserialize_with = "bool_from_int")] pub _lightscalehdr: bool, #[serde(deserialize_with = "bool_from_int")] @@ -1149,86 +1367,131 @@ pub struct Light { pub origin: Vector, } #[derive(Debug, Clone, Deserialize)] -pub struct LightEnvironment<'a> { - pub _ambient: LightColor, - pub _ambienthdr: &'a str, - pub _light: LightColor, - pub _lighthdr: LightColor, - pub angles: Vector, +pub struct LightEnvironment { + pub _ambient: Color, + pub _ambienthdr: Vector, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub _ambientscalehdr: bool, + pub _light: Color, + pub _lighthdr: Vector, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub _lightscalehdr: bool, + pub angles: Angles, pub origin: Vector, - pub pitch: f32, + #[serde(default)] + pub pitch: Option, + #[serde(default)] + pub sunspreadangle: Option, } #[derive(Debug, Clone, Deserialize)] pub struct LogicAuto<'a> { pub onmapspawn: &'a str, pub origin: Vector, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, } #[derive(Debug, Clone, Deserialize)] pub struct LogicRelay<'a> { pub ontrigger: &'a str, pub origin: Vector, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct LogicTimer<'a> { - pub lowerrandombound: i32, + #[serde(default)] + pub lowerrandombound: Option, pub ontimer: &'a str, pub origin: Vector, - pub spawnflags: u32, + #[serde(default)] + pub refiretime: Option, #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub startdisabled: bool, - pub upperrandombound: i32, + #[serde(default)] + pub targetname: Option<&'a str>, + #[serde(default)] + pub upperrandombound: Option, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub userandomtime: bool, } #[derive(Debug, Clone, Deserialize)] pub struct MathCounter<'a> { - pub max: i32, - pub min: i32, + pub max: u8, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub min: bool, pub onhitmax: &'a str, pub origin: Vector, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub startdisabled: bool, - pub startvalue: i32, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub startvalue: bool, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct MoveRope<'a> { - pub angles: Vector, + #[serde(default)] + pub angles: Option, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub barbed: bool, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub breakable: bool, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub collide: bool, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub dangling: bool, - pub maxdxlevel: u8, - pub mindxlevel: u8, - pub movespeed: f32, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub maxdxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub mindxlevel: bool, + pub movespeed: u8, + #[serde(default)] + pub nextkey: Option<&'a str>, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub nowind: bool, pub origin: Vector, + #[serde(default)] + pub parentname: Option<&'a str>, pub positioninterpolator: u8, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub r#type: bool, pub ropematerial: &'a str, - pub slack: f32, - pub spawnflags: u32, + pub slack: u8, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub spawnflags: bool, pub subdiv: u8, pub targetname: &'a str, - pub texturescale: f32, - pub width: f32, + #[serde(deserialize_with = "bool_from_int")] + pub texturescale: bool, + pub width: u8, } #[derive(Debug, Clone, Deserialize)] pub struct PathTrack<'a> { - pub angles: Vector, + pub angles: Angles, #[serde(deserialize_with = "bool_from_int")] pub orientationtype: bool, pub origin: Vector, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub spawnflags: bool, pub target: &'a str, pub targetname: &'a str, } @@ -1241,7 +1504,9 @@ pub struct PhysBallsocket<'a> { #[derive(Debug, Clone, Deserialize)] pub struct PlayerSpeedmod<'a> { pub origin: Vector, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub spawnflags: bool, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] @@ -1261,53 +1526,83 @@ pub struct PointServercommand<'a> { } #[derive(Debug, Clone, Deserialize)] pub struct PointSpotlight<'a> { - pub angles: Vector, + pub angles: Angles, pub hdrcolorscale: f32, pub origin: Vector, pub renderamt: u8, pub rendercolor: Color, - pub spawnflags: u32, + pub spawnflags: u8, pub spotlightlength: f32, pub spotlightwidth: f32, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct PointTemplate<'a> { + #[serde(default)] + pub onentityspawned: Option<&'a str>, pub origin: Vector, - pub spawnflags: u32, + pub spawnflags: u8, pub targetname: &'a str, pub template01: &'a str, + #[serde(default)] + pub template02: Option<&'a str>, + #[serde(default)] + pub template03: Option<&'a str>, + #[serde(default)] + pub template04: Option<&'a str>, + #[serde(default)] + pub template05: Option<&'a str>, } #[derive(Debug, Clone, Deserialize)] pub struct PointViewcontrol<'a> { - pub acceleration: f32, - pub angles: Vector, - pub deceleration: f32, + pub acceleration: u16, + pub angles: Angles, + pub deceleration: u16, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub interpolatepositiontoplayer: bool, pub origin: Vector, - pub spawnflags: u32, - pub target: &'a str, + pub spawnflags: u8, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub speed: bool, + #[serde(default)] + pub target: Option<&'a str>, + #[serde(default)] + pub targetname: Option<&'a str>, pub wait: f32, } #[derive(Debug, Clone, Deserialize)] pub struct PropDynamic<'a> { - pub angles: Vector, + pub angles: Angles, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub disablebonefollowers: bool, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub disablereceiveshadows: bool, #[serde(deserialize_with = "bool_from_int")] pub disableshadows: bool, - pub explodedamage: u8, - pub exploderadius: f32, - pub fademaxdist: f32, - pub fademindist: f32, - pub fadescale: f32, - pub maxanimtime: f32, - pub maxdxlevel: u8, - pub minanimtime: f32, - pub mindxlevel: u8, + #[serde(deserialize_with = "bool_from_int")] + pub explodedamage: bool, + #[serde(deserialize_with = "bool_from_int")] + pub exploderadius: bool, + pub fademaxdist: u16, + pub fademindist: i32, + #[serde(deserialize_with = "bool_from_int")] + pub fadescale: bool, + pub maxanimtime: u8, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub maxdxlevel: bool, + pub minanimtime: u8, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub mindxlevel: bool, pub model: &'a str, pub origin: Vector, + #[serde(default)] + pub parentname: Option<&'a str>, #[serde(deserialize_with = "bool_from_int")] pub performancemode: bool, #[serde(deserialize_with = "bool_from_int")] @@ -1317,39 +1612,51 @@ pub struct PropDynamic<'a> { pub renderamt: u8, pub rendercolor: Color, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub renderfx: bool, - pub rendermode: u32, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub rendermode: bool, #[serde(deserialize_with = "bool_from_int")] pub setbodygroup: bool, - pub skin: u16, #[serde(deserialize_with = "bool_from_int")] - pub solid: bool, - pub spawnflags: u32, + #[serde(default)] + pub skin: bool, + pub solid: u8, + pub spawnflags: u16, #[serde(deserialize_with = "bool_from_int")] pub startdisabled: bool, } #[derive(Debug, Clone, Deserialize)] pub struct PropPhysics<'a> { - pub angles: Vector, + pub angles: Angles, #[serde(deserialize_with = "bool_from_int")] pub damagetoenablemotion: bool, - pub damagetype: u32, + #[serde(deserialize_with = "bool_from_int")] + pub damagetype: bool, #[serde(deserialize_with = "bool_from_int")] pub disablereceiveshadows: bool, #[serde(deserialize_with = "bool_from_int")] pub disableshadows: bool, - pub explodedamage: u8, - pub exploderadius: f32, - pub fademaxdist: f32, - pub fademindist: f32, - pub fadescale: f32, + #[serde(deserialize_with = "bool_from_int")] + pub explodedamage: bool, + #[serde(deserialize_with = "bool_from_int")] + pub exploderadius: bool, + pub fademaxdist: u16, + pub fademindist: u16, + #[serde(deserialize_with = "bool_from_int")] + pub fadescale: bool, #[serde(deserialize_with = "bool_from_int")] pub forcetoenablemotion: bool, pub inertiascale: f32, - pub massscale: f32, - pub maxdxlevel: u8, - pub mindxlevel: u8, - pub minhealthdmg: u8, + #[serde(deserialize_with = "bool_from_int")] + pub massscale: bool, + #[serde(deserialize_with = "bool_from_int")] + pub maxdxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + pub mindxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + pub minhealthdmg: bool, pub model: &'a str, #[serde(deserialize_with = "bool_from_int")] pub nodamageforces: bool, @@ -1363,33 +1670,43 @@ pub struct PropPhysics<'a> { pub rendercolor: Color, #[serde(deserialize_with = "bool_from_int")] pub renderfx: bool, - pub rendermode: u32, - pub shadowcastdist: f32, - pub skin: u16, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub rendermode: bool, + #[serde(deserialize_with = "bool_from_int")] + pub shadowcastdist: bool, + #[serde(deserialize_with = "bool_from_int")] + pub skin: bool, + pub spawnflags: u8, } #[derive(Debug, Clone, Deserialize)] pub struct PropPhysicsMultiplayer<'a> { - pub angles: Vector, + pub angles: Angles, #[serde(deserialize_with = "bool_from_int")] pub damagetoenablemotion: bool, - pub damagetype: u32, #[serde(deserialize_with = "bool_from_int")] + pub damagetype: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub disablereceiveshadows: bool, #[serde(deserialize_with = "bool_from_int")] pub disableshadows: bool, - pub explodedamage: u8, - pub exploderadius: f32, - pub fademaxdist: f32, - pub fademindist: f32, - pub fadescale: f32, #[serde(deserialize_with = "bool_from_int")] - pub forcetoenablemotion: bool, + pub explodedamage: bool, + #[serde(deserialize_with = "bool_from_int")] + pub exploderadius: bool, + pub fademaxdist: u16, + pub fademindist: i32, + #[serde(deserialize_with = "bool_from_int")] + pub fadescale: bool, + pub forcetoenablemotion: u16, pub inertiascale: f32, - pub massscale: f32, - pub maxdxlevel: u8, - pub mindxlevel: u8, - pub minhealthdmg: u8, + pub massscale: u8, + #[serde(deserialize_with = "bool_from_int")] + pub maxdxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + pub mindxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + pub minhealthdmg: bool, pub model: &'a str, #[serde(deserialize_with = "bool_from_int")] pub nodamageforces: bool, @@ -1397,212 +1714,343 @@ pub struct PropPhysicsMultiplayer<'a> { #[serde(deserialize_with = "bool_from_int")] pub performancemode: bool, pub physdamagescale: f32, - #[serde(deserialize_with = "bool_from_int")] - pub physicsmode: bool, + #[serde(default)] + pub physicsmode: Option, #[serde(deserialize_with = "bool_from_int")] pub pressuredelay: bool, pub renderamt: u8, pub rendercolor: Color, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub renderfx: bool, - pub rendermode: u32, - pub shadowcastdist: f32, - pub skin: u16, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub rendermode: bool, + #[serde(deserialize_with = "bool_from_int")] + pub shadowcastdist: bool, + #[serde(deserialize_with = "bool_from_int")] + pub skin: bool, + pub spawnflags: u16, } #[derive(Debug, Clone, Deserialize)] pub struct PropPhysicsOverride<'a> { - pub angles: Vector, + #[serde(default)] + pub _minlight: Option, + pub angles: Angles, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub body: bool, #[serde(deserialize_with = "bool_from_int")] pub damagetoenablemotion: bool, - pub damagetype: u32, + #[serde(deserialize_with = "bool_from_int")] + pub damagetype: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub disablereceiveshadows: bool, #[serde(deserialize_with = "bool_from_int")] pub disableshadows: bool, - pub explodedamage: u8, - pub exploderadius: f32, - pub fademaxdist: f32, - pub fademindist: f32, - pub fadescale: f32, + #[serde(deserialize_with = "bool_from_int")] + pub explodedamage: bool, + #[serde(deserialize_with = "bool_from_int")] + pub exploderadius: bool, + pub fademaxdist: u16, + pub fademindist: i32, + #[serde(deserialize_with = "bool_from_int")] + pub fadescale: bool, #[serde(deserialize_with = "bool_from_int")] pub forcetoenablemotion: bool, - pub health: u8, + #[serde(deserialize_with = "bool_from_int")] + pub health: bool, pub inertiascale: f32, pub massscale: f32, - pub maxdxlevel: u8, - pub mindxlevel: u8, - pub minhealthdmg: u8, + #[serde(deserialize_with = "bool_from_int")] + pub maxdxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + pub mindxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + pub minhealthdmg: bool, pub model: &'a str, + #[serde(default)] + pub modelscale: Option, #[serde(deserialize_with = "bool_from_int")] pub nodamageforces: bool, pub origin: Vector, - pub parentname: &'a str, + #[serde(default)] + pub parentname: Option<&'a str>, #[serde(deserialize_with = "bool_from_int")] pub performancemode: bool, pub physdamagescale: f32, #[serde(deserialize_with = "bool_from_int")] pub pressuredelay: bool, - pub shadowcastdist: f32, - pub skin: u16, - pub spawnflags: u32, + #[serde(default)] + pub renderamt: Option, + #[serde(default)] + pub rendercolor: Option, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub renderfx: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub rendermode: bool, + #[serde(deserialize_with = "bool_from_int")] + pub shadowcastdist: bool, + #[serde(deserialize_with = "bool_from_int")] + pub skin: bool, + pub spawnflags: u16, + #[serde(default)] + pub targetname: Option<&'a str>, } #[derive(Debug, Clone, Deserialize)] pub struct PropRagdoll<'a> { - pub angles: Vector, - pub fademindist: f32, - pub fadescale: f32, + pub angles: Angles, + pub fademindist: i32, + #[serde(deserialize_with = "bool_from_int")] + pub fadescale: bool, pub model: &'a str, pub modelscale: f32, pub origin: Vector, - pub skin: u16, - pub spawnflags: u32, - pub targetname: &'a str, + #[serde(deserialize_with = "bool_from_int")] + pub skin: bool, + pub spawnflags: u8, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub startdisabled: bool, + #[serde(default)] + pub targetname: Option<&'a str>, } #[derive(Debug, Clone, Deserialize)] pub struct ShadowControl { - pub angles: Vector, + pub angles: Angles, pub color: Color, - pub distance: f32, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub disableallshadows: bool, + pub distance: u8, pub origin: Vector, } #[derive(Debug, Clone, Deserialize)] pub struct SkyCamera { - pub angles: Vector, + pub angles: Angles, pub fogcolor: Color, pub fogcolor2: Color, - pub fogdir: Vector, + pub fogdir: Color, pub fogend: f32, pub fogstart: f32, pub origin: Vector, - pub scale: f32, + pub scale: u8, } #[derive(Debug, Clone, Deserialize)] pub struct TriggerGravity<'a> { pub gravity: f32, pub model: &'a str, pub origin: Vector, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, #[serde(deserialize_with = "bool_from_int")] pub startdisabled: bool, } #[derive(Debug, Clone, Deserialize)] pub struct TriggerHurt<'a> { - pub damage: i32, - pub damagecap: i32, + #[serde(default)] + pub angles: Option, + pub damage: f32, + pub damagecap: f32, #[serde(deserialize_with = "bool_from_int")] pub damagemodel: bool, - pub damagetype: u32, + pub damagetype: u8, pub model: &'a str, pub origin: Vector, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, #[serde(deserialize_with = "bool_from_int")] pub startdisabled: bool, + #[serde(default)] + pub targetname: Option<&'a str>, } #[derive(Debug, Clone, Deserialize)] pub struct TriggerLook<'a> { pub fieldofview: f32, - pub looktime: f32, + pub looktime: u8, pub model: &'a str, pub ontrigger: &'a str, pub origin: Vector, - pub spawnflags: u32, + pub spawnflags: u8, #[serde(deserialize_with = "bool_from_int")] pub startdisabled: bool, pub target: &'a str, - pub timeout: f32, + #[serde(deserialize_with = "bool_from_int")] + pub timeout: bool, } #[derive(Debug, Clone, Deserialize)] pub struct TriggerMultiple<'a> { + #[serde(default)] + pub angles: Option, + #[serde(default)] + pub filtername: Option<&'a str>, pub model: &'a str, + #[serde(default)] + pub onendtouch: Option<&'a str>, + #[serde(default)] + pub onendtouchall: Option<&'a str>, + #[serde(default)] + pub onstarttouch: Option<&'a str>, + #[serde(default)] + pub onstarttouchall: Option<&'a str>, pub ontrigger: &'a str, pub origin: Vector, - pub spawnflags: u32, + #[serde(default)] + pub parentname: Option<&'a str>, + pub spawnflags: u8, #[serde(deserialize_with = "bool_from_int")] pub startdisabled: bool, + #[serde(default)] + pub target: Option<&'a str>, + #[serde(default)] + pub targetname: Option<&'a str>, pub wait: f32, } #[derive(Debug, Clone, Deserialize)] pub struct TriggerOnce<'a> { - pub angles: Vector, + #[serde(default)] + pub angles: Option, pub model: &'a str, pub ontrigger: &'a str, pub origin: Vector, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, #[serde(deserialize_with = "bool_from_int")] pub startdisabled: bool, } #[derive(Debug, Clone, Deserialize)] pub struct TriggerPush<'a> { #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub alternateticksfix: bool, + #[serde(default)] + pub angles: Option, + #[serde(default)] + pub filtername: Option<&'a str>, pub model: &'a str, pub origin: Vector, + #[serde(default)] + pub parentname: Option<&'a str>, pub pushdir: Vector, - pub spawnflags: u32, + pub spawnflags: u8, pub speed: f32, #[serde(deserialize_with = "bool_from_int")] pub startdisabled: bool, + #[serde(default)] + pub targetname: Option<&'a str>, } #[derive(Debug, Clone, Deserialize)] pub struct TriggerSoundscape<'a> { + #[serde(default)] + pub angles: Option, pub model: &'a str, pub origin: Vector, pub soundscape: &'a str, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, #[serde(deserialize_with = "bool_from_int")] pub startdisabled: bool, } #[derive(Debug, Clone, Deserialize)] pub struct TriggerTeleport<'a> { - pub model: &'a str, + #[serde(default)] + pub angles: Option, + #[serde(default)] + pub filtername: Option<&'a str>, + #[serde(default)] + pub model: Option<&'a str>, + #[serde(default)] + pub onendtouch: Option<&'a str>, pub origin: Vector, - pub spawnflags: u32, + #[serde(default)] + pub parentname: Option<&'a str>, + pub spawnflags: u8, #[serde(deserialize_with = "bool_from_int")] pub startdisabled: bool, pub target: &'a str, + #[serde(default)] + pub targetname: Option<&'a str>, } #[derive(Debug, Clone, Deserialize)] pub struct WaterLodControl { pub cheapwaterenddistance: f32, pub cheapwaterstartdistance: f32, + #[serde(default)] + pub origin: Option, } #[derive(Debug, Clone, Deserialize)] pub struct WeaponAk47<'a> { - pub ammo: u32, - pub angles: Vector, + pub ammo: u16, + pub angles: Angles, + #[serde(default)] + pub onplayerpickup: Option<&'a str>, pub origin: Vector, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct WeaponAwp<'a> { - pub angles: Vector, + #[serde(default)] + pub ammo: Option, + pub angles: Angles, + #[serde(default)] + pub fademaxdist: Option, + #[serde(default)] + pub fademindist: Option, + #[serde(default)] + pub fadescale: Option, pub origin: Vector, - pub spawnflags: u32, + #[serde(default)] + pub renderamt: Option, + #[serde(default)] + pub rendercolor: Option, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct WeaponDeagle { - pub ammo: u32, - pub angles: Vector, + pub ammo: u8, + pub angles: Angles, pub origin: Vector, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub spawnflags: bool, } #[derive(Debug, Clone, Deserialize)] pub struct WeaponElite<'a> { - pub ammo: u32, - pub angles: Vector, + pub ammo: u8, + pub angles: Angles, + #[serde(default)] + pub fademaxdist: Option, + #[serde(default)] + pub fademindist: Option, + #[serde(default)] + pub fadescale: Option, pub origin: Vector, - pub spawnflags: u32, + #[serde(default)] + pub renderamt: Option, + #[serde(default)] + pub rendercolor: Option, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct WeaponFamas { - pub ammo: u32, - pub angles: Vector, + pub ammo: u8, + pub angles: Angles, pub fademaxdist: f32, pub fademindist: f32, pub fadescale: f32, - pub maxdxlevel: u8, - pub mindxlevel: u8, + #[serde(deserialize_with = "bool_from_int")] + pub maxdxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + pub mindxlevel: bool, #[serde(deserialize_with = "bool_from_int")] pub nodamageforces: bool, pub origin: Vector, @@ -1610,39 +2058,46 @@ pub struct WeaponFamas { pub rendercolor: Color, #[serde(deserialize_with = "bool_from_int")] pub renderfx: bool, - pub rendermode: u32, - pub shadowcastdist: f32, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub rendermode: bool, + #[serde(deserialize_with = "bool_from_int")] + pub shadowcastdist: bool, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, } #[derive(Debug, Clone, Deserialize)] pub struct WeaponFiveseven<'a> { - pub ammo: u32, - pub angles: Vector, + pub ammo: u16, + pub angles: Angles, pub origin: Vector, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct WeaponFlashbang<'a> { - pub angles: Vector, + pub angles: Angles, pub fademaxdist: f32, pub fademindist: f32, pub fadescale: f32, pub origin: Vector, pub renderamt: u8, pub rendercolor: Color, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] -pub struct WeaponG3Sg1 { - pub ammo: u32, - pub angles: Vector, +pub struct WeaponG3sg1 { + pub ammo: u8, + pub angles: Angles, pub fademaxdist: f32, pub fademindist: f32, pub fadescale: f32, - pub maxdxlevel: u8, - pub mindxlevel: u8, + #[serde(deserialize_with = "bool_from_int")] + pub maxdxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + pub mindxlevel: bool, #[serde(deserialize_with = "bool_from_int")] pub nodamageforces: bool, pub origin: Vector, @@ -1650,63 +2105,147 @@ pub struct WeaponG3Sg1 { pub rendercolor: Color, #[serde(deserialize_with = "bool_from_int")] pub renderfx: bool, - pub rendermode: u32, - pub shadowcastdist: f32, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub rendermode: bool, + #[serde(deserialize_with = "bool_from_int")] + pub shadowcastdist: bool, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, } #[derive(Debug, Clone, Deserialize)] pub struct WeaponGlock<'a> { - pub ammo: u32, - pub angles: Vector, + pub ammo: u16, + pub angles: Angles, pub origin: Vector, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct WeaponHegrenade<'a> { - pub angles: Vector, + pub angles: Angles, + #[serde(default)] + pub fademaxdist: Option, + #[serde(default)] + pub fademindist: Option, + #[serde(default)] + pub fadescale: Option, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub maxdxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub mindxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub nodamageforces: bool, pub origin: Vector, - pub spawnflags: u32, - pub targetname: &'a str, + #[serde(default)] + pub renderamt: Option, + #[serde(default)] + pub rendercolor: Option, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub renderfx: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub rendermode: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub shadowcastdist: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub spawnflags: bool, + #[serde(default)] + pub targetname: Option<&'a str>, } #[derive(Debug, Clone, Deserialize)] pub struct WeaponKnife<'a> { - pub angles: Vector, + pub angles: Angles, + pub onplayerpickup: &'a str, pub origin: Vector, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct WeaponM249<'a> { - pub ammo: u32, - pub angles: Vector, + pub ammo: u8, + pub angles: Angles, + #[serde(default)] + pub fademaxdist: Option, + #[serde(default)] + pub fademindist: Option, + #[serde(default)] + pub fadescale: Option, pub origin: Vector, - pub spawnflags: u32, + #[serde(default)] + pub renderamt: Option, + #[serde(default)] + pub rendercolor: Option, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct WeaponM3<'a> { - pub ammo: u32, - pub angles: Vector, + pub ammo: u16, + pub angles: Angles, pub origin: Vector, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] -pub struct WeaponM4A1 { - pub angles: Vector, +pub struct WeaponM4a1<'a> { + #[serde(default)] + pub ammo: Option, + pub angles: Angles, + #[serde(default)] + pub fademaxdist: Option, + #[serde(default)] + pub fademindist: Option, + #[serde(default)] + pub fadescale: Option, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub maxdxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub mindxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub nodamageforces: bool, pub origin: Vector, - pub spawnflags: u32, + #[serde(default)] + pub renderamt: Option, + #[serde(default)] + pub rendercolor: Option, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub renderfx: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub rendermode: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub shadowcastdist: bool, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, + #[serde(default)] + pub targetname: Option<&'a str>, } #[derive(Debug, Clone, Deserialize)] pub struct WeaponMac10 { - pub ammo: u32, - pub angles: Vector, + pub ammo: u8, + pub angles: Angles, pub fademaxdist: f32, pub fademindist: f32, pub fadescale: f32, - pub maxdxlevel: u8, - pub mindxlevel: u8, + #[serde(deserialize_with = "bool_from_int")] + pub maxdxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + pub mindxlevel: bool, #[serde(deserialize_with = "bool_from_int")] pub nodamageforces: bool, pub origin: Vector, @@ -1714,34 +2253,84 @@ pub struct WeaponMac10 { pub rendercolor: Color, #[serde(deserialize_with = "bool_from_int")] pub renderfx: bool, - pub rendermode: u32, - pub shadowcastdist: f32, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub rendermode: bool, + #[serde(deserialize_with = "bool_from_int")] + pub shadowcastdist: bool, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, } #[derive(Debug, Clone, Deserialize)] pub struct WeaponP90<'a> { - pub ammo: u32, - pub angles: Vector, + pub ammo: u16, + pub angles: Angles, + #[serde(default)] + pub fademaxdist: Option, + #[serde(default)] + pub fademindist: Option, + #[serde(default)] + pub fadescale: Option, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub maxdxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub mindxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub nodamageforces: bool, pub origin: Vector, - pub spawnflags: u32, - pub targetname: &'a str, + #[serde(default)] + pub renderamt: Option, + #[serde(default)] + pub rendercolor: Option, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub renderfx: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub rendermode: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub shadowcastdist: bool, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, + #[serde(default)] + pub targetname: Option<&'a str>, } #[derive(Debug, Clone, Deserialize)] pub struct WeaponScout<'a> { - pub angles: Vector, + #[serde(default)] + pub ammo: Option, + pub angles: Angles, + #[serde(default)] + pub fademaxdist: Option, + #[serde(default)] + pub fademindist: Option, + #[serde(default)] + pub fadescale: Option, + #[serde(default)] + pub onplayerpickup: Option<&'a str>, pub origin: Vector, - pub spawnflags: u32, + #[serde(default)] + pub renderamt: Option, + #[serde(default)] + pub rendercolor: Option, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct WeaponSg550 { - pub ammo: u32, - pub angles: Vector, + pub ammo: u8, + pub angles: Angles, pub fademaxdist: f32, pub fademindist: f32, pub fadescale: f32, - pub maxdxlevel: u8, - pub mindxlevel: u8, + #[serde(deserialize_with = "bool_from_int")] + pub maxdxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + pub mindxlevel: bool, #[serde(deserialize_with = "bool_from_int")] pub nodamageforces: bool, pub origin: Vector, @@ -1749,26 +2338,32 @@ pub struct WeaponSg550 { pub rendercolor: Color, #[serde(deserialize_with = "bool_from_int")] pub renderfx: bool, - pub rendermode: u32, - pub shadowcastdist: f32, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub rendermode: bool, + #[serde(deserialize_with = "bool_from_int")] + pub shadowcastdist: bool, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, } #[derive(Debug, Clone, Deserialize)] pub struct WeaponSmokegrenade<'a> { - pub angles: Vector, + pub angles: Angles, pub origin: Vector, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] pub struct WeaponTmp { - pub ammo: u32, - pub angles: Vector, + pub ammo: u8, + pub angles: Angles, pub fademaxdist: f32, pub fademindist: f32, pub fadescale: f32, - pub maxdxlevel: u8, - pub mindxlevel: u8, + #[serde(deserialize_with = "bool_from_int")] + pub maxdxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + pub mindxlevel: bool, #[serde(deserialize_with = "bool_from_int")] pub nodamageforces: bool, pub origin: Vector, @@ -1776,19 +2371,24 @@ pub struct WeaponTmp { pub rendercolor: Color, #[serde(deserialize_with = "bool_from_int")] pub renderfx: bool, - pub rendermode: u32, - pub shadowcastdist: f32, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub rendermode: bool, + #[serde(deserialize_with = "bool_from_int")] + pub shadowcastdist: bool, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, } #[derive(Debug, Clone, Deserialize)] pub struct WeaponUmp45 { - pub ammo: u32, - pub angles: Vector, + pub ammo: u8, + pub angles: Angles, pub fademaxdist: f32, pub fademindist: f32, pub fadescale: f32, - pub maxdxlevel: u8, - pub mindxlevel: u8, + #[serde(deserialize_with = "bool_from_int")] + pub maxdxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + pub mindxlevel: bool, #[serde(deserialize_with = "bool_from_int")] pub nodamageforces: bool, pub origin: Vector, @@ -1796,37 +2396,59 @@ pub struct WeaponUmp45 { pub rendercolor: Color, #[serde(deserialize_with = "bool_from_int")] pub renderfx: bool, - pub rendermode: u32, - pub shadowcastdist: f32, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub rendermode: bool, + #[serde(deserialize_with = "bool_from_int")] + pub shadowcastdist: bool, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, } #[derive(Debug, Clone, Deserialize)] pub struct WeaponUsp<'a> { - pub ammo: u32, - pub angles: Vector, + pub ammo: u8, + pub angles: Angles, pub origin: Vector, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, pub targetname: &'a str, } #[derive(Debug, Clone, Deserialize)] -pub struct WeaponXm1014 { - pub ammo: u32, - pub angles: Vector, - pub fademaxdist: f32, - pub fademindist: f32, - pub fadescale: f32, - pub maxdxlevel: u8, - pub mindxlevel: u8, +pub struct WeaponXm1014<'a> { + pub ammo: u16, + pub angles: Angles, + #[serde(default)] + pub fademaxdist: Option, + #[serde(default)] + pub fademindist: Option, + #[serde(default)] + pub fadescale: Option, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub maxdxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub mindxlevel: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub nodamageforces: bool, pub origin: Vector, - pub renderamt: u8, - pub rendercolor: Color, + #[serde(default)] + pub renderamt: Option, + #[serde(default)] + pub rendercolor: Option, #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] pub renderfx: bool, - pub rendermode: u32, - pub shadowcastdist: f32, - pub spawnflags: u32, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub rendermode: bool, + #[serde(deserialize_with = "bool_from_int")] + #[serde(default)] + pub shadowcastdist: bool, + #[serde(deserialize_with = "bool_from_int")] + pub spawnflags: bool, + #[serde(default)] + pub targetname: Option<&'a str>, } #[derive(Debug, Clone, Deserialize)] pub struct Worldspawn<'a> {