Skip to content

Commit

Permalink
make ignored objects a developer config option
Browse files Browse the repository at this point in the history
  • Loading branch information
super-continent committed Nov 25, 2024
1 parent 872b73a commit 0da3156
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/sammi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ impl Default for SammiConfig {
pub struct SammiDevConfig {
/// States which indicate an attack should be [`HitType::Throw`]
throw_states: Vec<String>,
/// Object names that should not send a createObject event
ignored_objects: Vec<String>,
}

impl Default for SammiDevConfig {
Expand Down Expand Up @@ -111,7 +113,12 @@ impl Default for SammiDevConfig {
]
.map(|s| s.to_string())
.to_vec();
SammiDevConfig { throw_states }

let ignored_objects = ["BallZanzoh"].map(|s| s.to_string()).to_vec();
SammiDevConfig {
throw_states,
ignored_objects,
}
}
}

Expand Down Expand Up @@ -672,8 +679,9 @@ pub unsafe fn create_object_with_arg_hook(object: *mut u8, arg: *mut u8, _ptr: *

let object_name = process_string(&read_type::<[u8; 32]>(arg));

// keep venom from overloading the sammi connection
if object_name == "BallZanzoh" {
let config = SAMMI_CONFIG.get().unwrap();

if config.developer_data.ignored_objects.contains(&object_name) {
return;
}

Expand Down

0 comments on commit 0da3156

Please sign in to comment.