diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index daa6030d..d3b72bf9 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -421,7 +421,7 @@ bool PlayerManager::OnClientConnect(edict_t *pEntity, const char *pszName, const pPlayer->Initialize(pszName, pszAddress, pEntity); m_clconnect->PushCell(client); - m_clconnect->PushStringEx(reject, maxrejectlen, SM_PARAM_STRING_UTF8, SM_PARAM_COPYBACK); + m_clconnect->PushStringEx(reject, maxrejectlen, SM_PARAM_STRING_UTF8 | SM_PARAM_STRING_COPY, SM_PARAM_COPYBACK); m_clconnect->PushCell(maxrejectlen); m_clconnect->Execute(&res); diff --git a/extensions/tf2/criticals.cpp b/extensions/tf2/criticals.cpp index 7d6233e7..1c5ecb57 100644 --- a/extensions/tf2/criticals.cpp +++ b/extensions/tf2/criticals.cpp @@ -35,7 +35,6 @@ IServerGameEnts *gameents = NULL; CDetour *calcIsAttackCriticalDetour = NULL; CDetour *calcIsAttackCriticalMeleeDetour = NULL; -CDetour *calcIsAttackCriticalKnifeDetour = NULL; IForward *g_critForward = NULL; @@ -152,24 +151,6 @@ DETOUR_DECL_MEMBER0(CalcIsAttackCriticalHelperMelee, bool) } } -DETOUR_DECL_MEMBER0(CalcIsAttackCriticalHelperKnife, bool) -{ - DetourResult result = DetourCallback((CBaseEntity *)this); - - if (result == Result_Ignore) - { - return DETOUR_MEMBER_CALL(CalcIsAttackCriticalHelperKnife)(); - } - else if (result == Result_NoCrit) - { - return 0; - } - else - { - return 1; - } -} - DETOUR_DECL_MEMBER0(CalcIsAttackCriticalHelper, bool) { DetourResult result = DetourCallback((CBaseEntity *)this); @@ -192,7 +173,6 @@ void InitialiseDetours() { calcIsAttackCriticalDetour = DETOUR_CREATE_MEMBER(CalcIsAttackCriticalHelper, "CalcCritical"); calcIsAttackCriticalMeleeDetour = DETOUR_CREATE_MEMBER(CalcIsAttackCriticalHelperMelee, "CalcCriticalMelee"); - calcIsAttackCriticalKnifeDetour = DETOUR_CREATE_MEMBER(CalcIsAttackCriticalHelperKnife, "CalcCriticalKnife"); bool HookCreated = false; @@ -208,12 +188,6 @@ void InitialiseDetours() HookCreated = true; } - if (calcIsAttackCriticalKnifeDetour != NULL) - { - calcIsAttackCriticalKnifeDetour->EnableDetour(); - HookCreated = true; - } - if (!HookCreated) { g_pSM->LogError(myself, "No critical hit forwards could be initialized - Disabled critical hit hooks"); @@ -226,5 +200,4 @@ void RemoveDetours() { calcIsAttackCriticalDetour->Destroy(); calcIsAttackCriticalMeleeDetour->Destroy(); - calcIsAttackCriticalKnifeDetour->Destroy(); } diff --git a/gamedata/sdktools.games/game.tf.txt b/gamedata/sdktools.games/game.tf.txt index ae53bb3f..babacce5 100644 --- a/gamedata/sdktools.games/game.tf.txt +++ b/gamedata/sdktools.games/game.tf.txt @@ -48,8 +48,8 @@ } "CommitSuicide" { - "windows" "390" - "linux" "390" + "windows" "391" + "linux" "391" } "GetVelocity" { diff --git a/gamedata/sm-tf2.games.txt b/gamedata/sm-tf2.games.txt index 9e79c172..ba8c2ec7 100644 --- a/gamedata/sm-tf2.games.txt +++ b/gamedata/sm-tf2.games.txt @@ -45,13 +45,6 @@ "linux" "@_ZN18CTFWeaponBaseMelee26CalcIsAttackCriticalHelperEv" "windows" "\x83\xEC\x08\x53\x57\x8B\xF9\xE8\x2A\x2A\x2A\x2A\x8B\xD8" } - "CalcCriticalKnife" - { - "library" "server" - "linux" "@_ZN8CTFKnife26CalcIsAttackCriticalHelperEv" - "windows" "\x8B\x81\xF0\x13\x00\x00\x83\xF8\xFF\x74\x29\x8B\x15" - } - } "Offsets" { diff --git a/plugins/include/clients.inc b/plugins/include/clients.inc index 6da5d95a..75387f3d 100644 --- a/plugins/include/clients.inc +++ b/plugins/include/clients.inc @@ -63,6 +63,10 @@ public const MaxClients; /**< Maximum number of players the server supports (dyn * If you return false (or return nothing), the client will be rejected. If the client is * rejected by this forward or any other, OnClientDisconnect will not be called. * + * Note: Do not write to rejectmsg if you plan on returning true. If multiple plugins write + * to the string buffer, it is not defined which plugin's string will be shown to the client, + * but it is guaranteed one of them will. + * * @param client Client index. * @param rejectmsg Buffer to store the rejection message when the connection is refused. * @param maxlen Maximum number of characters for rejection buffer. diff --git a/public/compat_wrappers.h b/public/compat_wrappers.h index 40b6534d..cf4db072 100644 --- a/public/compat_wrappers.h +++ b/public/compat_wrappers.h @@ -84,7 +84,7 @@ { if (strcmp(pBase->GetName(), name) == 0) { - if (pBase->IsCommand()) + if (!pBase->IsCommand()) { return NULL; }