Skip to content

Commit

Permalink
fix: use real_name_to_og_name to map real prop names to friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
dankotov committed Aug 28, 2024
1 parent df87469 commit 8e204bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
18 changes: 10 additions & 8 deletions src/parser/src/first_pass/prop_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,12 @@ impl PropController {
self.prop_infos.push(PropInfo {
id: *custom_prop_id,
prop_type: PropType::Custom,
prop_name: FRIENDLY_NAMES_MAPPING
.get(&custom_prop_name)
.unwrap_or(&custom_prop_name)
prop_name: custom_prop_name.to_string(),
prop_friendly_name: self
.real_name_to_og_name
.get(&custom_prop_name.to_string())
.unwrap_or(&custom_prop_name.to_string())
.to_string(),
prop_friendly_name: custom_prop_name.to_string(),
is_player_prop: true,
})
}
Expand All @@ -167,11 +168,12 @@ impl PropController {
base: PropInfo {
id: *custom_prop_id,
prop_type: PropType::Custom,
prop_name: FRIENDLY_NAMES_MAPPING
.get(&custom_prop_name)
.unwrap_or(&custom_prop_name)
prop_name: custom_prop_name.to_string(),
prop_friendly_name: self
.real_name_to_og_name
.get(&custom_prop_name.to_string())
.unwrap_or(&custom_prop_name.to_string())
.to_string(),
prop_friendly_name: custom_prop_name.to_string(),
is_player_prop: true,
},
wanted_prop_state: wanted_state.clone(),
Expand Down
4 changes: 2 additions & 2 deletions src/parser/src/maps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1972,8 +1972,8 @@ pub static CUSTOM_PLAYER_PROP_IDS: phf::Map<&'static str, u32> = phf_map! {
"inventory" => INVENTORY_ID,
"inventory_as_ids" => INVENTORY_AS_IDS_ID,
"active_weapon_original_owner" => WEAPON_ORIGINGAL_OWNER_ID,
"active_weapon_name" => WEAPON_NAME_ID,
"active_weapon_skin" => WEAPON_SKIN_NAME,
"weapon_name" => WEAPON_NAME_ID,
"weapon_skin" => WEAPON_SKIN_NAME,
"weapon_skin_id" => WEAPON_SKIN_ID,
"weapon_paint_seed" => WEAPON_PAINT_SEED,
"weapon_float" => WEAPON_FLOAT,
Expand Down

0 comments on commit 8e204bb

Please sign in to comment.