feat: improve play all missions solo

This commit is contained in:
maybegreat48 committed 2025-04-10 10:53:03 -04:00
1 parent 4894756d6c
commit ac6e363375
4 files changed
+94 -10

No files matched your search

+4 -1
View File
@@ -36,7 +36,7 @@ namespace YimMenu
{
const auto size_minus_one = ida_sig.size() - 1;
m_Bytes.reserve(size_minus_one / 2);
for (size_t i = 0; i != size_minus_one; ++i)
for (size_t i = 0; i < size_minus_one; ++i)
{
if (ida_sig[i] == ' ')
continue;
@@ -47,11 +47,14 @@ namespace YimMenu
if (c1 && c2)
{
m_Bytes.emplace_back(static_cast<uint8_t>((*c1 * 0x10) + *c2));
i++;
}
}
else
{
m_Bytes.push_back({});
if (ida_sig[i + 1] == '?')
i++;
}
}
}
@@ -12,6 +12,13 @@ namespace YimMenu::Features
ScriptPatch m_MissionRequestPatch2{};
ScriptPatch m_MissionRequestPatch3{};
ScriptPatch m_MissionRequestPatch4{};
ScriptPatch m_PlayerCountWatchdogPatch1{};
ScriptPatch m_PlayerCountWatchdogPatch2{};
ScriptPatch m_HeistTeamsPatch{};
ScriptPatch m_ShouldFailMissionPatch1{}; // god I hate this function
std::vector<ScriptPatch> m_ShouldFailMissionPatches{};
ScriptPatch m_ShouldFailMissionPatch2{};
ScriptPatch m_EnsureMissionPassedPatch{};
virtual void OnEnable() override
{
@@ -29,7 +36,7 @@ namespace YimMenu::Features
if (!m_MissionRequestPatch2)
{
m_MissionRequestPatch2 = ScriptPatches::AddPatch("freemode"_J, "25 ? 37 07 33 37 07 5D ? ? ? 39 11", 20, {0x48});
m_MissionRequestPatch2 = ScriptPatches::AddPatch("freemode"_J, "25 ? 37 07 33 37 07 5D ? ? ? 39 11", 20, {0x72});
}
m_MissionRequestPatch2->Enable();
@@ -44,6 +51,52 @@ namespace YimMenu::Features
m_MissionRequestPatch4 = ScriptPatches::AddPatch("freemode"_J, "5D ? ? ? 39 06 38 01 5D ? ? ? 25", 0, {0x72, 0x2E, 0x04, 0x01});
}
m_MissionRequestPatch4->Enable();
if (!m_PlayerCountWatchdogPatch1)
{
m_PlayerCountWatchdogPatch1 = ScriptPatches::AddPatch("fmmc_launcher"_J, "2D 02 09 00 00 25 A4", 5, {0x71, 0x2E, 0x02, 0x01});
}
m_PlayerCountWatchdogPatch1->Enable();
if (!m_PlayerCountWatchdogPatch2)
{
m_PlayerCountWatchdogPatch2 = ScriptPatches::AddPatch("fmmc_launcher"_J, "2D 04 0B 00 00 2C ? ? ? 71 5D", 5, {0x71, 0x2E, 0x04, 0x01});
}
m_PlayerCountWatchdogPatch2->Enable();
if (!m_HeistTeamsPatch)
{
m_HeistTeamsPatch = ScriptPatches::AddPatch("fmmc_launcher"_J, "47 ? ? 5B 7B 00 38 04", 0, {0x2B, 0x2B, 0x00, 0x55});
}
m_HeistTeamsPatch->Enable();
if (!m_ShouldFailMissionPatch1)
{
m_ShouldFailMissionPatch1 = ScriptPatches::AddPatch("fm_mission_controller"_J, "50 ? ? 78 82 06 1F 56 ? ? 38 02", 0, {0x00, 0x00, 0x00, 0x72, 0x00});
}
m_ShouldFailMissionPatch1->Enable();
if (m_ShouldFailMissionPatches.empty())
{
// TODO: this is a very bad idea that can break anytime
for (int i = 0; i < 4; i++)
m_ShouldFailMissionPatches.push_back(ScriptPatches::AddPatch("fm_mission_controller"_J, "38 02 5D ? ? ? 71 09 2A 56 07 00 71 5D ? ? ? 06 1F 56", 0, {0x71, 0x00, 0x00, 0x00, 0x00, 0x00}));
}
for (auto& patch : m_ShouldFailMissionPatches)
patch->Enable();
if (!m_ShouldFailMissionPatch2)
{
m_ShouldFailMissionPatch2 = ScriptPatches::AddPatch("fm_mission_controller"_J, "56 07 00 38 02 5D ? ? ? 20 56 BC 01", 0, {0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x71});
}
m_ShouldFailMissionPatch2->Enable();
if (!m_EnsureMissionPassedPatch)
{
m_EnsureMissionPassedPatch = ScriptPatches::AddPatch("fm_mission_controller"_J, "55 C8 FF 61", 3, {0x2E, 0x00, 0x00});
}
m_EnsureMissionPassedPatch->Enable();
}
virtual void OnDisable() override
@@ -72,6 +125,39 @@ namespace YimMenu::Features
{
m_MissionRequestPatch4->Disable();
}
if (m_PlayerCountWatchdogPatch2)
{
m_PlayerCountWatchdogPatch2->Disable();
}
if (m_PlayerCountWatchdogPatch2)
{
m_PlayerCountWatchdogPatch2->Disable();
}
if (m_HeistTeamsPatch)
{
m_HeistTeamsPatch->Disable();
}
if (m_ShouldFailMissionPatch1)
{
m_ShouldFailMissionPatch1->Disable();
}
for (auto& patch : m_ShouldFailMissionPatches)
patch->Disable();
if (m_ShouldFailMissionPatch2)
{
m_ShouldFailMissionPatch2->Disable();
}
if (m_EnsureMissionPassedPatch)
{
m_EnsureMissionPassedPatch->Disable();
}
}
};
@@ -162,6 +162,7 @@ namespace YimMenu::Submenus
switch (GSBDRandomEvents->EventData[event].State)
{
case eRandomEventState::INACTIVE:
case eRandomEventState::CLEANUP:
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.0f, 0.0f, 1.0f));
break;
case eRandomEventState::AVAILABLE:
+2 -8
View File
@@ -45,7 +45,7 @@ namespace rage
if (page < num)
{
if (page == num - 1)
return m_CodeSize & 0x3FFF;
return (m_CodeSize & 0x3FFF);
return 0x4000;
}
@@ -54,13 +54,7 @@ namespace rage
std::uint32_t GetFullCodeSize() const
{
auto numPages = GetNumCodePages();
if (!numPages)
return 0;
if (numPages == 1)
--numPages;
return (numPages * 0x4000) + (m_CodeSize & 0x3FFF);
return m_CodeSize;
}
std::uint8_t* GetCodePage(std::uint32_t page) const