check latest commit

This commit is contained in:
RabbyDevs 2025-05-11 01:38:18 +03:00
parent 8bda4f0d01
commit 8af090bcac

View file

@ -111,27 +111,27 @@ macro_rules! create_player_entity_pb {
}}; }};
} }
const CONCOM_ROLE_ID: &[(i32, i32)] = &[ // const CONCOM_ROLE_ID: &[(i32, i32)] = &[
(38, 1407), // (38, 1407),
(36, 1105), // (36, 1105),
(35, 1506), // (35, 1506),
]; // ];
fn get_role_id_from_concom(key: i32) -> Option<i32> { // fn get_role_id_from_concom(key: i32) -> Option<i32> {
CONCOM_ROLE_ID.iter().find(|&&(k, _)| k == key).map(|&(_, v)| v) // CONCOM_ROLE_ID.iter().find(|&&(k, _)| k == key).map(|&(_, v)| v)
} // }
fn extract_concom_number(s: String) -> Option<i32> { // fn extract_concom_number(s: String) -> Option<i32> {
let prefix = "Player0"; // let prefix = "Player0";
if !s.starts_with(prefix) { // if !s.starts_with(prefix) {
return None; // return None;
} // }
let rest = &s[prefix.len()..]; // Skip "Player0" // let rest = &s[prefix.len()..]; // Skip "Player0"
let underscore_index = rest.find('_')?; // let underscore_index = rest.find('_')?;
let number_str = &rest[..underscore_index]; // let number_str = &rest[..underscore_index];
number_str.parse::<i32>().ok() // number_str.parse::<i32>().ok()
} // }
pub fn add_player_entities(player: &Player) { pub fn add_player_entities(player: &Player) {
let mut world_ref = player.world.borrow_mut(); let mut world_ref = player.world.borrow_mut();
@ -152,8 +152,9 @@ pub fn add_player_entities(player: &Player) {
for (_, blueprint_config) in wicked_waifus_data::blueprint_config_data::iter().filter(|(_, bc)| { for (_, blueprint_config) in wicked_waifus_data::blueprint_config_data::iter().filter(|(_, bc)| {
bc.blueprint_type.starts_with("Player0") && bc.entity_type == EntityType::Monster bc.blueprint_type.starts_with("Player0") && bc.entity_type == EntityType::Monster
}) { }) {
let blueprint_role_id = get_role_id_from_concom(extract_concom_number(blueprint_config.blueprint_type.clone()).unwrap()); // let blueprint_role_id = get_role_id_from_concom(extract_concom_number(blueprint_config.blueprint_type.clone()).unwrap());
if blueprint_role_id.is_none() {continue} // if blueprint_role_id.is_none() {continue}
let (_, template_config) = wicked_waifus_data::template_config_data::iter().find(|(_, tc)| tc.blueprint_type == blueprint_config.blueprint_type).unwrap(); let (_, template_config) = wicked_waifus_data::template_config_data::iter().find(|(_, tc)| tc.blueprint_type == blueprint_config.blueprint_type).unwrap();
tracing::debug!( tracing::debug!(
@ -186,14 +187,12 @@ pub fn add_player_entities(player: &Player) {
.with(ComponentContainer::Autonomous(Autonomous { autonomous_id: player.basic_info.id })) .with(ComponentContainer::Autonomous(Autonomous { autonomous_id: player.basic_info.id }))
.with(ComponentContainer::Visibility(Visibility { is_visible: false, is_actor_visible: true })) .with(ComponentContainer::Visibility(Visibility { is_visible: false, is_actor_visible: true }))
.with(ComponentContainer::Position(Position(player.location.position.clone()))) .with(ComponentContainer::Position(Position(player.location.position.clone())))
// .with(ComponentContainer::Attribute(Attribute { attr_map: template_config.components_data.attribute_component.unwrap(), hardness_mode_id: (), rage_mode_id: () })) .with(ComponentContainer::Position(Position(player.location.position.clone())))
// .with(ComponentContainer::Fsm(Fsm { hash_code: (), common_hash_code: (), state_list: (), node_list: () })) .build();
.build();
tracing::debug!( tracing::debug!(
"created concom entity, id: {}, role_id: {}", "created concom entity, id: {}",
template_config.id, template_config.id
blueprint_role_id.unwrap()
); );
} }
for role in role_vec { for role in role_vec {