-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MP S&L and AutoSave #24
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,3 +179,44 @@ DEFINE_HOOK(0x4FC57C, HouseClass__MPlayerDefeated_CheckAliveAndHumans, 0x7) | |
} | ||
|
||
#pragma endregion MPlayerDefeated | ||
|
||
#pragma region Save&Load | ||
|
||
DEFINE_HOOK_AGAIN(0x624271, SomeFunc_InterceptMainLoop, 0x5); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While patching at the call sites is valid, with the number of extensions YR has it might be a better idea to patch in at the end of the function itself perhaps. |
||
DEFINE_HOOK_AGAIN(0x623D72, SomeFunc_InterceptMainLoop, 0x5); | ||
DEFINE_HOOK_AGAIN(0x62314E, SomeFunc_InterceptMainLoop, 0x5); | ||
DEFINE_HOOK_AGAIN(0x60D407, SomeFunc_InterceptMainLoop, 0x5); | ||
DEFINE_HOOK_AGAIN(0x608206, SomeFunc_InterceptMainLoop, 0x5); | ||
DEFINE_HOOK(0x48CE8A, SomeFunc_InterceptMainLoop, 0x5) | ||
{ | ||
/** | ||
* Main loop. | ||
*/ | ||
reinterpret_cast<void(__fastcall*)()>(0x55D360)(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ehhh... How about adding the function to YRpp maybe. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dunno how to commit it. XD There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same |
||
|
||
/** | ||
* After loop. | ||
*/ | ||
Spawner::After_Main_Loop(); | ||
return R->Origin() + 0x5; | ||
} | ||
|
||
DEFINE_HOOK(0x52DAED, Game_Start_ResetGlobal, 0x7) | ||
{ | ||
Spawner::DoSave = false; | ||
Spawner::NextAutoSaveFrame = -1; | ||
Spawner::NextAutoSaveNumber = 0; | ||
return 0; | ||
} | ||
|
||
DEFINE_HOOK(0x686B20, INIClass_ReadScenario_AutoSave, 0x6) | ||
{ | ||
/** | ||
* Schedule the next autosave. | ||
*/ | ||
Spawner::NextAutoSaveFrame = Unsorted::CurrentFrame; | ||
Spawner::NextAutoSaveFrame += Spawner::GetConfig()->AutoSaveInterval; | ||
return 0; | ||
} | ||
|
||
#pragma endregion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this is a valid approach, the game already has a save event. You can send that and just replace its execution code in EventClass::Execute