fix(self menu gui): fix self menu erroring when not yet in the game but still in the main menu / first loading screen (#2235)

This commit is contained in:
Quentin 2023-10-10 21:48:14 +02:00 committed by GitHub
parent 7689d0e11c
commit b43dfc82f8

View File

@ -30,7 +30,8 @@ namespace big
components::command_checkbox<"godmode">();
components::command_checkbox<"otr">();
if (g.self.off_radar && scr_globals::gpbd_fm_3.as<GPBD_FM_3*>()->Entries[self::id].BossGoon.Boss == self::id)
const auto gpbd_fm_3 = scr_globals::gpbd_fm_3.as<GPBD_FM_3*>();
if (g.self.off_radar && *g_pointers->m_gta.m_is_session_started && gpbd_fm_3->Entries[self::id].BossGoon.Boss == self::id)
components::command_checkbox<"ghostorg">();
components::command_checkbox<"freecam">();
components::command_checkbox<"nophone">();
@ -40,11 +41,13 @@ namespace big
if (g.self.invisibility)
components::command_checkbox<"localvis">(); // TODO: does nothing in SP
ImGui::BeginDisabled(scr_globals::gpbd_fm_3.as<GPBD_FM_3*>()->Entries[self::id].BossGoon.Boss != -1
|| gta_util::find_script_thread(RAGE_JOAAT("fm_mission_controller"))
|| gta_util::find_script_thread(RAGE_JOAAT("fm_mission_controller_2020")));
components::command_checkbox<"passive">();
// clang-format off
ImGui::BeginDisabled(!*g_pointers->m_gta.m_is_session_started ||
gpbd_fm_3->Entries[self::id].BossGoon.Boss != -1 ||
gta_util::find_script_thread(RAGE_JOAAT("fm_mission_controller")) ||
gta_util::find_script_thread(RAGE_JOAAT("fm_mission_controller_2020")));
// clang-format on
components::command_checkbox<"passive">();
ImGui::EndDisabled();
ImGui::EndGroup();