Auto party friend

This commit is contained in:
LightCat 2019-03-21 18:23:38 +01:00
parent 8aa3c8765d
commit 43f068c659

View File

@ -6,6 +6,7 @@
#include "ChIRC.hpp"
#include "hack.hpp"
#include "ucccccp.hpp"
#include "PlayerTools.hpp"
namespace IRC
{
@ -320,8 +321,25 @@ CatCommand debug_steamids("debug_steamids", "Debug steamids", []() {
logging::Info("%u", i.second.steamid);
});
static Timer resize_party{};
static Timer pass_leader{};
static Timer friend_party_t{};
void friend_party()
{
if (friend_party_t.test_and_set(10000))
{
re::CTFPartyClient *pc = re::CTFPartyClient::GTFPartyClient();
if (pc)
{
std::vector<unsigned> valid_steam_ids = pc->GetPartySteamIDs();
for (auto steamid : valid_steam_ids)
if (steamid && player_tools::shouldTargetSteamId(steamid))
playerlist::AccessData(steamid).state = playerlist::k_EState::CAT;
}
}
}
void party_leader_pass()
{
if (pass_leader.test_and_set(10000))
{
re::CTFGCClientSystem *gc = re::CTFGCClientSystem::GTFGCClientSystem();
re::CTFPartyClient *pc = re::CTFPartyClient::GTFPartyClient();
@ -352,6 +370,7 @@ void party_leader_pass()
}
}
}
}
static void run()
{