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/BigBaseV2/src/features/never_wanted.cpp

26 lines
595 B
C++
Raw Normal View History

#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
}
}