Skip to content

Commit d375d2e

Browse files
authored
Merge pull request #2303 from HDR-Development/smashline-2-fixes
Fix Custom Gamemodes
2 parents 08bc3dc + 2baba07 commit d375d2e

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

fighters/common/src/function_hooks/attack.rs

+12-6
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,13 @@ unsafe fn attack_module_set_attack(module: u64, id: i32, group: i32, data: &mut
5353
unsafe fn get_damage_frame_mul(ctx: &mut skyline::hooks::InlineCtx) {
5454
match utils::game_modes::get_custom_mode() {
5555
Some(modes) => {
56-
if modes.contains(&CustomMode::Smash64Mode) {
57-
let damage_frame_mul_n64: f32 = 0.533;
58-
asm!("fmov s0, w8", in("w8") damage_frame_mul_n64)
56+
let damage_frame_mul: f32 = if modes.contains(&CustomMode::Smash64Mode) {
57+
0.533
5958
}
59+
else {
60+
0.42
61+
};
62+
asm!("fmov s0, w8", in("w8") damage_frame_mul)
6063
},
6164
_ => {}
6265
}
@@ -66,10 +69,13 @@ unsafe fn get_damage_frame_mul(ctx: &mut skyline::hooks::InlineCtx) {
6669
unsafe fn get_hitstop_frame_add(ctx: &mut skyline::hooks::InlineCtx) {
6770
match utils::game_modes::get_custom_mode() {
6871
Some(modes) => {
69-
if modes.contains(&CustomMode::Smash64Mode) {
70-
let hitstop_frame_add_n64: f32 = 5.0;
71-
asm!("fmov s0, w8", in("w8") hitstop_frame_add_n64)
72+
let hitstop_frame_add: f32 = if modes.contains(&CustomMode::Smash64Mode) {
73+
5.0
7274
}
75+
else {
76+
4.0
77+
};
78+
asm!("fmov s0, w8", in("w8") hitstop_frame_add)
7379
},
7480
_ => {}
7581
}

utils/src/game_modes.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ unsafe fn once_per_game_frame(game_state_ptr: u64) {
161161

162162
pub fn install() {
163163
skyline::install_hooks!(
164-
// on_rule_select_hook,
165-
// once_per_game_frame
164+
on_rule_select_hook,
165+
once_per_game_frame
166166
);
167167
}

utils/src/offsets.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ mod offsets_impl {
419419
offsets.map_controls = byte_search(MAP_CONTROLS_SEARCH_CODE).expect("Unable to find control mapping function!");
420420
offsets.once_per_game_frame = byte_search(ONCE_PER_GAME_FRAME_SEARCH_CODE).expect("Unable to find once-per-game-frame function!");
421421
offsets.on_rule_select = byte_search(ON_RULE_SELECT_SEARCH_CODE).expect("Unable to find on-rule-select instructions!");
422-
offsets.global_frame_counter = 0x52e6b44;
422+
offsets.global_frame_counter = 0x52e8b44;
423423
offsets.get_match_mode = {
424424
let offset = byte_search(GET_MATCH_MODE_SEARCH_CODE).expect("Unable to find get_match_mode!") - GET_MATCH_MODE_OFFSET_TO_START;
425425
let bl_offset = offset_from_bl(offset);

0 commit comments

Comments
 (0)