1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2024-11-24 02:44:17 +00:00

Keep Mii hats and Luma on save state load; Fix Github Actions (#532)

* Exclude Mii hats and Luma

* Use allowlist to fix clippy

* More clippy

* More clippy

* Unnecessary cast

* Unnecessary vec!

* Spacing

* Import ordering

* Use a different action for test

---------

Co-authored-by: GradualSyrup <68757075+GradualSyrup@users.noreply.github.com>
This commit is contained in:
jugeeya 2023-07-11 09:10:56 -07:00 committed by GitHub
parent b34fc6b4a9
commit e0ef313297
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 9 deletions

View file

@ -50,10 +50,10 @@ jobs:
command: clippy
args: --all-targets --all-features --target=x86_64-unknown-linux-gnu -- -D warnings
- name: TUI Test
uses: actions-rs/cargo@v1
continue-on-error: false
uses: ClementTsang/cargo-action@v0.0.3
with:
working-directory: training_mod_tui
command: test
directory: training_mod_tui
plugin:
name: Plugin NRO
runs-on: ubuntu-latest

View file

@ -70,8 +70,7 @@ pub fn is_operation_cpu(module_accessor: &mut app::BattleObjectModuleAccessor) -
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;
let fighter_information = FighterManager::get_fighter_information(mgr, entry_id);
FighterInformation::is_operation_cpu(fighter_information)
}

View file

@ -32,7 +32,7 @@ unsafe fn was_in_shieldstun(module_accessor: *mut app::BattleObjectModuleAccesso
macro_rules! actionable_statuses {
() => {
vec![
[
FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_ESCAPE_AIR,
FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_ATTACK_AIR,
FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_GUARD_ON,

View file

@ -4,6 +4,7 @@ use log::info;
use parking_lot::Mutex;
use serde::{Deserialize, Serialize};
use smash::app::{self, lua_bind::*, Item};
use smash::cpp::l2c_value::LuaConst;
use smash::hash40;
use smash::lib::lua_const::*;
use smash::phx::{Hash40, Vector3f};
@ -29,6 +30,24 @@ use crate::training::reset;
use crate::training::ui::notifications;
use crate::{is_ptrainer, ITEM_MANAGER_ADDR};
// Don't remove Mii hats, or Luma, or crafting table
const ARTICLE_ALLOWLIST: [(LuaConst, LuaConst); 5] = [
(
FIGHTER_KIND_MIIFIGHTER,
FIGHTER_MIIFIGHTER_GENERATE_ARTICLE_HAT,
),
(
FIGHTER_KIND_MIISWORDSMAN,
FIGHTER_MIISWORDSMAN_GENERATE_ARTICLE_HAT,
),
(
FIGHTER_KIND_MIIGUNNER,
FIGHTER_MIIGUNNER_GENERATE_ARTICLE_HAT,
),
(FIGHTER_KIND_ROSETTA, FIGHTER_ROSETTA_GENERATE_ARTICLE_TICO),
(FIGHTER_KIND_PICKEL, FIGHTER_PICKEL_GENERATE_ARTICLE_TABLE),
];
extern "C" {
#[link_name = "\u{1}_ZN3app14sv_information8stage_idEv"]
pub fn stage_id() -> i32;
@ -296,10 +315,10 @@ unsafe fn on_death(fighter_kind: i32, module_accessor: &mut app::BattleObjectMod
// All articles have ID <= 0x25
(0..=0x25)
// Don't remove crafting table
.filter(|article_idx| {
!(fighter_kind == *FIGHTER_KIND_PICKEL
&& *article_idx == *FIGHTER_PICKEL_GENERATE_ARTICLE_TABLE)
!ARTICLE_ALLOWLIST.iter().any(|article_allowed| {
article_allowed.0 == fighter_kind && article_allowed.1 == *article_idx
})
})
.for_each(|article_idx| {
if ArticleModule::is_exist(module_accessor, article_idx) {