centralize hardcore check (#720)
This commit is contained in:
parent
a1da699580
commit
d8ec09d475
@ -49,9 +49,7 @@ pub fn run_game(device: &mut Device, rom_contents: Vec<u8>, game_settings: ui::g
|
||||
if game_settings.disable_expansion_pak {
|
||||
device.rdram.size = 0x400000;
|
||||
}
|
||||
if let Some(slot) = game_settings.load_savestate_slot
|
||||
&& !retroachievements::get_hardcore()
|
||||
{
|
||||
if let Some(slot) = game_settings.load_savestate_slot {
|
||||
device.ui.storage.save_state_slot = slot;
|
||||
device.load_state = true;
|
||||
}
|
||||
|
||||
@ -100,6 +100,9 @@ pub fn create_savestate(device: &device::Device) {
|
||||
}
|
||||
|
||||
pub fn load_savestate(device: &mut device::Device) {
|
||||
if retroachievements::get_hardcore() {
|
||||
return;
|
||||
}
|
||||
let savestate = std::fs::read(&device.ui.storage.paths.savestate_file_path);
|
||||
if let Ok(savestate) = &savestate {
|
||||
let device_bytes = ui::storage::decompress_file(savestate, "device");
|
||||
|
||||
@ -159,7 +159,7 @@ pub fn check_callback(device: &mut device::Device) -> (bool, bool) {
|
||||
if device.netplay.is_none() {
|
||||
if callback.save_state {
|
||||
device.save_state = true;
|
||||
} else if callback.load_state && !retroachievements::get_hardcore() {
|
||||
} else if callback.load_state {
|
||||
device.load_state = true;
|
||||
}
|
||||
if callback.reset_game {
|
||||
|
||||
Reference in New Issue
Block a user