Fix anti auto balance issues and clang format
This commit is contained in:
parent
b5e61150be
commit
a829849619
@ -815,7 +815,8 @@ int UniformRandomInt(int min, int max)
|
||||
while (len)
|
||||
{
|
||||
bound = (1U + RAND_MAX) % len;
|
||||
while ((r = rand()) < bound);
|
||||
while ((r = rand()) < bound)
|
||||
;
|
||||
result *= 1U + RAND_MAX;
|
||||
result += r % len;
|
||||
len -= len > RAND_MAX ? RAND_MAX : len;
|
||||
|
@ -113,7 +113,7 @@ DEFINE_HOOKED_METHOD(DispatchUserMessage, bool, void *this_, int type, bf_read &
|
||||
logging::Info("%s", data.c_str());
|
||||
if (data.find("TeamChangeP") != data.npos && CE_GOOD(LOCAL_E))
|
||||
{
|
||||
std::string server_name = server->GetName();
|
||||
std::string server_name(server->GetAddress());
|
||||
if (server_name != previous_name)
|
||||
{
|
||||
previous_name = server_name;
|
||||
|
@ -69,7 +69,8 @@ int re::CTFPartyClient::LoadSavedCasualCriteria()
|
||||
{
|
||||
typedef int (*LoadSavedCasualCriteria_t)(re::CTFPartyClient *);
|
||||
static uintptr_t addr = gSignatures.GetClientSignature("55 89 E5 8B 45 ? 5D 8B 80 ? ? ? ? C3 66 90 55 89 E5 "
|
||||
"8B 45 ? 5D 0F B6 80 ? ? ? ? C3 90 55 89 E5 56") - 0x40;
|
||||
"8B 45 ? 5D 0F B6 80 ? ? ? ? C3 90 55 89 E5 56") -
|
||||
0x40;
|
||||
static LoadSavedCasualCriteria_t LoadSavedCasualCriteria_fn = LoadSavedCasualCriteria_t(addr);
|
||||
|
||||
return LoadSavedCasualCriteria_fn(this);
|
||||
|
@ -77,8 +77,7 @@ void dispatchUserMessage(bf_read &buffer, int type)
|
||||
if (!g_IEngine->GetPlayerInfo(eid, &info) || !g_IEngine->GetPlayerInfo(caller, &info2))
|
||||
break;
|
||||
|
||||
logging::Info("Vote called to kick %s [U:1:%u] for %s by %s [U:1:%u]",
|
||||
info.name, info.friendsID, reason, info2.name, info2.friendsID);
|
||||
logging::Info("Vote called to kick %s [U:1:%u] for %s by %s [U:1:%u]", info.name, info.friendsID, reason, info2.name, info2.friendsID);
|
||||
if (eid == LOCAL_E->m_IDX)
|
||||
was_local_player = true;
|
||||
|
||||
@ -103,9 +102,7 @@ void dispatchUserMessage(bf_read &buffer, int type)
|
||||
if (*party_say)
|
||||
{
|
||||
char formated_string[256];
|
||||
std::snprintf(formated_string, sizeof(formated_string),
|
||||
"[CAT] votekick called: %s => %s (%s)",
|
||||
info2.name, info.name, reason);
|
||||
std::snprintf(formated_string, sizeof(formated_string), "[CAT] votekick called: %s => %s (%s)", info2.name, info.name, reason);
|
||||
re::CTFPartyClient::GTFPartyClient()->SendPartyChat(formated_string);
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user