fix party bugs

This commit is contained in:
LightCat 2018-10-16 16:54:11 +02:00
parent e875cd0187
commit 366defe9eb
2 changed files with 15 additions and 2 deletions

View File

@ -312,7 +312,7 @@ static HookedFunction cm(HF_CreateMove, "catbot", 5, []() {
!HasCondition<TFCond_Disguised>(LOCAL_E) && disguise.test_and_set(3000))
{
int teamtodisguise =
(LOCAL_E->m_iTeam() == TEAM_RED) ? TEAM_BLU : TEAM_RED;
(LOCAL_E->m_iTeam() == TEAM_RED) ? TEAM_BLU - 1 : TEAM_RED - 1;
int classtojoin = classes[rand() % 3];
g_IEngine->ClientCmd_Unrestricted(
format("disguise ", classtojoin, " ", teamtodisguise).c_str());

View File

@ -316,7 +316,20 @@ static HookedFunction paint(HookedFunctions_types::HF_Paint, "IRC", 16, []() {
if (last_sent_steamid.check(8000) && calledonce.test_and_set(2000) && online_members < *party_size)
{
if (!steamidvec.empty() && party_client && online_members != 6 && online_members < GetMaxParty())
hack::command_stack().push("tf_party_leave");
{
steamidvec.push_back(
g_ISteamUser->GetSteamID().GetAccountID());
int idx = -1;
unsigned lowest = UINT_MAX;
for (int i = 0; i < steamidvec.size(); i++)
if (steamidvec[i] < lowest)
{
lowest = steamidvec[i];
idx = i;
}
if (idx != -1 && steamidvec[idx] == g_ISteamUser->GetSteamID().GetAccountID())
hack::command_stack().push("tf_party_leave");
}
}
if (last_steamid_received.test_and_set(10000) && online_members < *party_size)
{