1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2024-11-28 04:44:06 +00:00

safer option usage

This commit is contained in:
GradualSyrup 2023-09-21 13:05:37 -05:00
parent 7e6267817e
commit d7a00e7227

View file

@ -173,10 +173,12 @@ fn into_transition_term(starting_status: StartingStatus) -> i32 {
} }
pub unsafe fn handle_recording() { pub unsafe fn handle_recording() {
let player_module_accessor = get_module_accessor(FighterId::Player); let player_module_accessor = try_get_module_accessor(FighterId::Player);
let cpu_module_accessor = get_module_accessor(FighterId::CPU); let cpu_module_accessor = try_get_module_accessor(FighterId::CPU);
handle_recording_for_fighter(&mut *player_module_accessor); if player_module_accessor.is_some() && cpu_module_accessor.is_some() {
handle_recording_for_fighter(&mut *cpu_module_accessor); handle_recording_for_fighter(&mut *player_module_accessor.unwrap());
handle_recording_for_fighter(&mut *cpu_module_accessor.unwrap());
}
} }
unsafe fn handle_recording_for_fighter(module_accessor: &mut BattleObjectModuleAccessor) { unsafe fn handle_recording_for_fighter(module_accessor: &mut BattleObjectModuleAccessor) {