This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
YimMenu/src/backend/looped/session/force_thunder.cpp

37 lines
1.1 KiB
C++
Raw Normal View History

2022-12-06 16:12:02 +00:00
#include "backend/looped/looped.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "gta_util.hpp"
#include "util/session.hpp"
namespace big
{
static bool bLastForceThunderEnabled = false;
void looped::session_force_thunder()
{
bool used = g.session.force_thunder && *g_pointers->m_is_session_started;
2022-12-06 16:12:02 +00:00
if (!bLastForceThunderEnabled && used)
{
if (!STREAMING::IS_PLAYER_SWITCH_IN_PROGRESS() && gta_util::find_script_thread(RAGE_JOAAT("freemode")) && SCRIPT::GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH(RAGE_JOAAT("maintransition")) == 0)
{
session::set_fm_event_index(9);
session::set_fm_event_index(10);
session::set_fm_event_index(11);
bLastForceThunderEnabled = true;
}
}
else if (bLastForceThunderEnabled && !used)
{
if (*g_pointers->m_is_session_started && !STREAMING::IS_PLAYER_SWITCH_IN_PROGRESS() && gta_util::find_script_thread(RAGE_JOAAT("freemode")))
{
session::clear_fm_event_index(9);
session::clear_fm_event_index(10);
session::clear_fm_event_index(11);
}
bLastForceThunderEnabled = false;
}
}
}