feat(Features): Added never wanted looped feature

This commit is contained in:
Yimura 2020-12-26 19:34:05 +01:00
parent 8539614d9b
commit ebb14e073d
No known key found for this signature in database
GPG Key ID: 54EFAD29393A6E78
3 changed files with 28 additions and 0 deletions

View File

@ -13,6 +13,7 @@ namespace big
update_screen_sizes();
god_mode();
never_wanted();
off_radar();
no_ragdoll();
}

View File

@ -24,6 +24,7 @@ namespace big
void script_func();
void god_mode();
void never_wanted();
void off_radar();
void no_ragdoll();

View File

@ -0,0 +1,26 @@
#include "features.hpp"
namespace big
{
static bool bLastNeverWanted = false;
void features::never_wanted()
{
QUEUE_JOB_BEGIN_CLAUSE()
{
bool bNeverWanted = g_settings.options["never_wanted"].get<bool>();
if (bNeverWanted && PLAYER::GET_PLAYER_WANTED_LEVEL(g_playerId) > 0)
{
PLAYER::SET_PLAYER_WANTED_LEVEL(g_playerId, 0, true);
PLAYER::SET_MAX_WANTED_LEVEL(0);
}
else if (!bNeverWanted && bNeverWanted != bLastNeverWanted)
{
PLAYER::SET_MAX_WANTED_LEVEL(5);
}
bLastNeverWanted = bNeverWanted;
}QUEUE_JOB_END_CLAUSE
}
}