mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2025-03-16 11:26:11 +00:00
fix is_operation_cpu
This commit is contained in:
parent
bcd0ca5a28
commit
49ffcdc31c
3 changed files with 20 additions and 13 deletions
|
@ -39,13 +39,11 @@ pub unsafe fn is_operation_cpu(module_accessor: &mut app::BattleObjectModuleAcce
|
|||
|
||||
let entry_id_int =
|
||||
WorkModule::get_int(module_accessor, *FIGHTER_INSTANCE_WORK_ID_INT_ENTRY_ID) as i32;
|
||||
let _entry_id = app::FighterEntryID(entry_id_int);
|
||||
// let mut mgr = FighterManager{_address : fighter_manager_addr as u64};
|
||||
// let fighter_information = lua_bind::FighterManager::get_fighter_information(&mut mgr, entry_id) as *mut FighterInformation;
|
||||
// println!("FighterInformation: {:#?}", fighter_information);
|
||||
let entry_id = app::FighterEntryID(entry_id_int);
|
||||
let mgr = *(FIGHTER_MANAGER_ADDR as *mut *mut app::FighterManager);
|
||||
let fighter_information = FighterManager::get_fighter_information( mgr, entry_id) as *mut app::FighterInformation;
|
||||
|
||||
// lua_bind::FighterInformation::is_operation_cpu(fighter_information)
|
||||
entry_id_int > 0
|
||||
FighterInformation::is_operation_cpu(fighter_information)
|
||||
}
|
||||
|
||||
pub unsafe fn is_in_hitstun(module_accessor: &mut app::BattleObjectModuleAccessor) -> bool {
|
||||
|
|
13
src/lib.rs
13
src/lib.rs
|
@ -24,11 +24,24 @@ fn nro_main(nro: &NroInfo<'_>) {
|
|||
}
|
||||
}
|
||||
|
||||
#[skyline::hook(replace = smash::app::lua_bind::FighterManager::get_fighter_information)]
|
||||
pub unsafe fn handle_get_fighter_information(
|
||||
fighter_manager: &mut smash::app::FighterManager,
|
||||
entry_id: smash::app::FighterEntryID,
|
||||
) -> u64 {
|
||||
println!("{:#?}", &fighter_manager as *const _);
|
||||
println!("[Training Modpack] FighterManager address: 0x{:x}", FIGHTER_MANAGER_ADDR);
|
||||
println!("[Training Modpack] FighterManager deref: 0x{:x}", *(FIGHTER_MANAGER_ADDR as *mut u64));
|
||||
|
||||
original!()(fighter_manager, entry_id)
|
||||
}
|
||||
|
||||
#[skyline::main(name = "training_modpack")]
|
||||
pub fn main() {
|
||||
println!("[Training Modpack] Initialized.");
|
||||
hitbox_visualizer::hitbox_visualization();
|
||||
training::training_mods();
|
||||
skyline::install_hook!(handle_get_fighter_information);
|
||||
nro::add_hook(nro_main).unwrap();
|
||||
|
||||
unsafe {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::common::FIGHTER_MANAGER_ADDR;
|
||||
use crate::hitbox_visualizer;
|
||||
use skyline::{c_str, nn::ro::LookupSymbol};
|
||||
use skyline::nn::ro::LookupSymbol;
|
||||
use smash::app::{self, lua_bind::*};
|
||||
|
||||
pub mod directional_influence;
|
||||
|
@ -168,22 +168,18 @@ pub unsafe fn handle_change_motion(
|
|||
}
|
||||
|
||||
pub fn training_mods() {
|
||||
println!("Applying training mods.");
|
||||
println!("[Training Modpack] Applying training mods.");
|
||||
unsafe {
|
||||
LookupSymbol(
|
||||
&mut FIGHTER_MANAGER_ADDR,
|
||||
c_str("_ZN3lib9SingletonIN3app14FighterManagerEE9instance_E"),
|
||||
"_ZN3lib9SingletonIN3app14FighterManagerEE9instance_E\u{0}".as_bytes().as_ptr(),
|
||||
);
|
||||
println!("Lookup symbol output: {:#?}", FIGHTER_MANAGER_ADDR);
|
||||
}
|
||||
|
||||
skyline::install_hooks!(
|
||||
// Mash airdodge/jump
|
||||
handle_get_command_flag_cat,
|
||||
|
||||
// Set DI
|
||||
// handle_get_float,
|
||||
|
||||
// Hold/Infinite shield
|
||||
handle_check_button_on,
|
||||
handle_check_button_off,
|
||||
|
|
Loading…
Add table
Reference in a new issue