Skip to content

Commit 76bc745

Browse files
committed
Meter bugfixes
1 parent 81a1c30 commit 76bc745

File tree

7 files changed

+29
-11
lines changed

7 files changed

+29
-11
lines changed

fighters/dolly/src/opff.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,9 @@ unsafe fn magic_series(fighter: &mut L2CFighterCommon, boma: &mut BattleObjectMo
841841

842842
pub extern "C" fn dolly_meter(fighter: &mut smash::lua2cpp::L2CFighterCommon) {
843843
unsafe {
844+
if !sv_information::is_ready_go() && fighter.status_frame() < 1 {
845+
return;
846+
}
844847
MeterModule::update(fighter.object(), false);
845848
// if fighter.is_button_on(Buttons::AppealAll) {
846849
// MeterModule::show(fighter.object());
@@ -873,6 +876,6 @@ pub unsafe fn dolly_frame(fighter: &mut smash::lua2cpp::L2CFighterCommon) {
873876
pub fn install() {
874877
smashline::Agent::new("dolly")
875878
.on_line(Main, dolly_frame_wrapper)
876-
.on_line(Exec, dolly_meter)
879+
.on_line(Main, dolly_meter)
877880
.install();
878881
}

fighters/ken/src/opff.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ extern "Rust" {
6464

6565
unsafe extern "C" fn ken_meter(fighter: &mut smash::lua2cpp::L2CFighterCommon) {
6666
unsafe {
67+
if !sv_information::is_ready_go() && fighter.status_frame() < 1 {
68+
return;
69+
}
6770
MeterModule::update(fighter.battle_object, false);
6871
MeterModule::set_meter_cap(fighter.object(), 10);
6972
MeterModule::set_meter_per_level(fighter.object(), 30.0);
@@ -401,6 +404,6 @@ unsafe fn target_combos(boma: &mut BattleObjectModuleAccessor) {
401404
pub fn install() {
402405
smashline::Agent::new("ken")
403406
.on_line(Main, ken_frame_wrapper)
404-
.on_line(Exec, ken_meter)
407+
.on_line(Main, ken_meter)
405408
.install();
406409
}

fighters/lucario/src/opff.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ use globals::*;
55

66
pub extern "C" fn lucario_meter(fighter: &mut smash::lua2cpp::L2CFighterCommon) {
77
unsafe {
8+
if !sv_information::is_ready_go() && fighter.status_frame() < 1 {
9+
return;
10+
}
811
MeterModule::update(fighter.object(), false);
912
MeterModule::set_meter_cap(fighter.object(), 2);
1013
MeterModule::set_meter_per_level(fighter.object(), 100.0);
@@ -367,6 +370,6 @@ unsafe fn magic_series(fighter: &mut L2CFighterCommon, boma: &mut BattleObjectMo
367370
pub fn install() {
368371
smashline::Agent::new("lucario")
369372
.on_line(Main, lucario_frame_wrapper)
370-
.on_line(Exec, lucario_meter)
373+
.on_line(Main, lucario_meter)
371374
.install();
372375
}

fighters/palutena/src/opff.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,9 @@ unsafe fn power_cast(fighter: &mut L2CFighterCommon) {
311311

312312
pub extern "C" fn palu_power_board(fighter: &mut smash::lua2cpp::L2CFighterCommon) {
313313
unsafe {
314+
if !sv_information::is_ready_go() && fighter.status_frame() < 1 {
315+
return;
316+
}
314317
MeterModule::update(fighter.object(), false);
315318
MeterModule::set_meter_cap(fighter.object(), 2);
316319
utils::ui::UiManager::set_power_board_enable(fighter.get_int(*FIGHTER_INSTANCE_WORK_ID_INT_ENTRY_ID) as u32, true);
@@ -339,10 +342,7 @@ pub unsafe fn palutena_frame(fighter: &mut smash::lua2cpp::L2CFighterCommon) {
339342
}
340343

341344
pub extern "C" fn reflection_board_callback(weapon: &mut smash::lua2cpp::L2CFighterBase) {
342-
unsafe {
343-
if weapon.kind() != WEAPON_KIND_PALUTENA_REFLECTIONBOARD {
344-
return
345-
}
345+
unsafe {
346346
if weapon.is_status(*WEAPON_PALUTENA_REFLECTIONBOARD_STATUS_KIND_SHOOT) {
347347
let owner_id = WorkModule::get_int(weapon.module_accessor, *WEAPON_INSTANCE_WORK_ID_INT_LINK_OWNER) as u32;
348348
let palutena = utils::util::get_battle_object_from_id(owner_id);
@@ -357,7 +357,7 @@ pub extern "C" fn reflection_board_callback(weapon: &mut smash::lua2cpp::L2CFigh
357357
pub fn install() {
358358
smashline::Agent::new("palutena")
359359
.on_line(Main, palutena_frame_wrapper)
360-
.on_line(Exec, palu_power_board)
360+
.on_line(Main, palu_power_board)
361361
.install();
362362
smashline::Agent::new("palutena_reflectionboard")
363363
.on_line(Main, reflection_board_callback)

fighters/pichu/src/opff.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ unsafe fn charge_training_taunt(fighter: &mut L2CFighterCommon, boma: &mut Battl
163163

164164
pub extern "C" fn pichu_meter(fighter: &mut smash::lua2cpp::L2CFighterCommon) {
165165
unsafe {
166+
if !sv_information::is_ready_go() && fighter.status_frame() < 1 {
167+
return;
168+
}
166169
MeterModule::update(fighter.object(), false);
167170
MeterModule::set_meter_cap(fighter.object(), 2);
168171
MeterModule::set_meter_per_level(fighter.object(), 25.0);
@@ -216,6 +219,6 @@ pub unsafe fn pichu_frame(fighter: &mut smash::lua2cpp::L2CFighterCommon) {
216219
pub fn install() {
217220
smashline::Agent::new("pichu")
218221
.on_line(Main, pichu_frame_wrapper)
219-
.on_line(Exec, pichu_meter)
222+
.on_line(Main, pichu_meter)
220223
.install();
221224
}

fighters/robot/src/opff.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ pub unsafe fn moveset(fighter: &mut smash::lua2cpp::L2CFighterCommon, boma: &mut
203203

204204
unsafe extern "C" fn robot_meter(fighter: &mut smash::lua2cpp::L2CFighterCommon) {
205205
unsafe {
206+
if !sv_information::is_ready_go() && fighter.status_frame() < 1 {
207+
return;
208+
}
206209
MeterModule::update(fighter.object(), false);
207210
utils::ui::UiManager::set_robot_meter_enable(fighter.get_int(*FIGHTER_INSTANCE_WORK_ID_INT_ENTRY_ID) as u32, true);
208211
utils::ui::UiManager::set_robot_meter_info(
@@ -229,6 +232,6 @@ pub unsafe fn robot_frame(fighter: &mut smash::lua2cpp::L2CFighterCommon) {
229232
pub fn install() {
230233
smashline::Agent::new("robot")
231234
.on_line(Main, robot_frame_wrapper)
232-
.on_line(Exec, robot_meter)
235+
.on_line(Main, robot_meter)
233236
.install();
234237
}

fighters/ryu/src/opff.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ extern "Rust" {
6363

6464
unsafe extern "C" fn ryu_meter(fighter: &mut smash::lua2cpp::L2CFighterCommon) {
6565
unsafe {
66+
if !sv_information::is_ready_go() && fighter.status_frame() < 1 {
67+
return;
68+
}
6669
MeterModule::update(fighter.battle_object, false);
6770
utils::ui::UiManager::set_ex_meter_enable(fighter.get_int(*FIGHTER_INSTANCE_WORK_ID_INT_ENTRY_ID) as u32, true);
6871
utils::ui::UiManager::set_ex_meter_info(
@@ -537,6 +540,6 @@ unsafe fn hadoken_fadc_sfs_cancels(fighter: &mut L2CFighterCommon, boma: &mut Ba
537540
pub fn install() {
538541
smashline::Agent::new("ryu")
539542
.on_line(Main, ryu_frame_wrapper)
540-
.on_line(Exec, ryu_meter)
543+
.on_line(Main, ryu_meter)
541544
.install();
542545
}

0 commit comments

Comments
 (0)