Skip to content

Commit 193c730

Browse files
committed
Disable alts code (temporary)
1 parent a17a23f commit 193c730

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

fighters/common/src/function_hooks/stage_hazards.rs

+20-17
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ extern "C" {
1010

1111
#[skyline::hook(offset = 0x30F6DE0)]
1212
unsafe fn stub(arg: u64) {
13-
if get_stage_id() == 0x8f && get_current_stage_alt() == 0 {
13+
// if get_stage_id() == 0x8f && get_current_stage_alt() == 0 {
1414
return;
15-
} else {
16-
call_original!(arg);
17-
}
15+
// } else {
16+
// call_original!(arg);
17+
// }
1818
}
1919

2020
#[skyline::hook(offset = 0x5209c0)]
@@ -23,9 +23,10 @@ unsafe fn area_manager_process(manager: *const u64) {
2323
let end = *manager.add(2);
2424
while start != end {
2525
let current = *(start as *const u64);
26-
if *(current as *mut u8).add(0x20) == 0x1b
27-
&& (get_stage_id() == 0x8f && get_current_stage_alt() == 0)
28-
{
26+
// if *(current as *mut u8).add(0x20) == 0x1b
27+
// && (get_stage_id() == 0x8f && get_current_stage_alt() == 0)
28+
// {
29+
if *(current as *mut u8).add(0x20) == 0x1b && get_stage_id() == 0x8f {
2930
*(current as *mut bool).add(0x21) = false;
3031
*((current + 0x40) as *mut f32) = 0.0;
3132
*((current + 0x40) as *mut f32).add(1) = 0.0;
@@ -57,9 +58,10 @@ static HAZARDLESS_STAGE_IDS: &[u32] = &[
5758
#[skyline::hook(offset = 0x178ab60, inline)]
5859
unsafe fn init_stage(ctx: &mut skyline::hooks::InlineCtx) {
5960
let stage_id = *ctx.registers[1].w.as_ref();
60-
let is_alt_haz_off = ([0x59].contains(&stage_id) && get_current_stage_alt() == 0)
61-
|| (stage_id == 0x68 && get_current_stage_alt() == 0);
62-
if HAZARDLESS_STAGE_IDS.contains(&stage_id) || is_alt_haz_off {
61+
// let is_alt_haz_off = ([0x59].contains(&stage_id) && get_current_stage_alt() == 0)
62+
// || (stage_id == 0x68 && get_current_stage_alt() == 0);
63+
// if HAZARDLESS_STAGE_IDS.contains(&stage_id) || is_alt_haz_off {
64+
if HAZARDLESS_STAGE_IDS.contains(&stage_id) || stage_id == 0x68 || stage_id == 0x59 {
6365
*ctx.registers[3].w.as_mut() = 0;
6466
}
6567
}
@@ -76,9 +78,10 @@ unsafe fn handle_movement_grav_update(ctx: &mut skyline::hooks::InlineCtx) {
7678
unsafe fn fix_hazards_for_online(ctx: &skyline::hooks::InlineCtx) {
7779
let ptr = *ctx.registers[1].x.as_ref();
7880
let stage_id = *(ptr as *const u16) as u32;
79-
let is_alt_haz_off = ([0x59].contains(&stage_id) && get_current_stage_alt() == 0)
80-
|| (stage_id == 0x68 && get_current_stage_alt() == 0);
81-
if HAZARDLESS_STAGE_IDS.contains(&stage_id) || is_alt_haz_off {
81+
// let is_alt_haz_off = ([0x59].contains(&stage_id) && get_current_stage_alt() == 0)
82+
// || (stage_id == 0x68 && get_current_stage_alt() == 0);
83+
// if HAZARDLESS_STAGE_IDS.contains(&stage_id) || is_alt_haz_off {
84+
if HAZARDLESS_STAGE_IDS.contains(&stage_id) || stage_id == 0x68 || stage_id == 0x59 {
8285
*(ptr as *mut bool).add(0x10) = false;
8386
}
8487
}
@@ -97,11 +100,11 @@ unsafe fn lylat_no_rot(ctx: &mut skyline::hooks::InlineCtx) {
97100
// 0x4 - default haz off space
98101
#[skyline::hook(offset = 0x297D68C, inline)]
99102
unsafe fn lylat_set_form_hazards_off(ctx: &mut skyline::hooks::InlineCtx) {
100-
if get_current_stage_alt() == 0 {
101-
*ctx.registers[8].x.as_mut() = 0x2;
102-
} else {
103+
// if get_current_stage_alt() == 0 {
104+
// *ctx.registers[8].x.as_mut() = 0x2;
105+
// } else {
103106
*ctx.registers[8].x.as_mut() = 0x4;
104-
}
107+
// }
105108
}
106109

107110
pub fn install() {

0 commit comments

Comments
 (0)