Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paint_seed to int #200

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading