Skip to content

Commit

Permalink
paint_seed to int (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
LaihoE authored Aug 6, 2024
1 parent 8837223 commit 4973a9a
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 43 deletions.
82 changes: 41 additions & 41 deletions src/parser/src/e2e_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2363,47 +2363,47 @@ mod tests {
let prop = (
"weapon_paint_seed",
PropColumn {
data: Some(F32(vec![
None,
Some(647.8849),
None,
None,
None,
None,
Some(201.31105),
None,
None,
None,
Some(762.7262),
Some(804.3764),
None,
Some(760.18475),
None,
Some(16.234646),
None,
Some(760.18475),
None,
Some(711.0891),
Some(762.7262),
Some(377.8302),
None,
None,
Some(410.4961),
None,
None,
None,
Some(528.8964),
Some(711.0891),
None,
Some(410.4961),
None,
None,
None,
Some(976.17224),
Some(201.31105),
None,
None,
Some(362.73822),
data: Some(U32(vec![
Some(0),
Some(647),
Some(0),
Some(0),
Some(0),
Some(0),
Some(201),
Some(0),
Some(0),
Some(0),
Some(762),
Some(804),
Some(0),
Some(760),
Some(0),
Some(16),
Some(0),
Some(760),
Some(0),
Some(711),
Some(762),
Some(377),
Some(0),
Some(0),
Some(410),
Some(0),
Some(0),
Some(0),
Some(528),
Some(711),
Some(0),
Some(410),
Some(0),
Some(0),
Some(0),
Some(976),
Some(201),
Some(0),
Some(0),
Some(362),
])),
num_nones: 0,
},
Expand Down
6 changes: 4 additions & 2 deletions src/parser/src/second_pass/collect_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,11 @@ impl<'a> SecondPassParser<'a> {
}
pub fn find_skin_paint_seed(&self, player: &PlayerMetaData) -> Result<Variant, PropCollectionError> {
if let Some(player_entity_id) = &player.player_entity_id {
return self.find_weapon_prop(&WEAPON_PAINT_SEED, &player_entity_id);
if let Ok(Variant::F32(f)) = self.find_weapon_prop(&WEAPON_PAINT_SEED, &player_entity_id) {
return Ok(Variant::U32(f as u32));
}
}
Err(PropCollectionError::PlayerNotFound)
return Ok(Variant::U32(0));
}
pub fn find_agent_skin(&self, player: &PlayerMetaData) -> Result<Variant, PropCollectionError> {
let id = match self.prop_controller.special_ids.agent_skin_idx {
Expand Down

0 comments on commit 4973a9a

Please sign in to comment.