Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cfg/cs2fixes/cs2fixes.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ cs2f_burn_slowdown 0.6 // The slowdown of each burn damage tick as a multipl
cs2f_burn_interval 0.3 // The interval between burn damage ticks

// Hide settings
cs2f_hide_weapons 0 // Whether to hide weapons along with their holders
cs2f_hide_distance_default 250 // The default distance for hide
cs2f_hide_distance_max 2000 // The max distance for hide
cs2f_hide_teammates_only 0 // Whether to hide teammates only
Expand Down
2 changes: 1 addition & 1 deletion gamedata/cs2fixes.games.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
{
"library" "server"
"windows" "\xC8\x42\xEB\x2A\x4C\x39\x67\x30"
"linux" "\xC8\x42\x41\xC7\x85\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\xE9\x2A\x2A\x2A\x2A\x4C\x89\xE7"
"linux" "\xC8\x42\x41\xC7\x85\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\xE9\x2A\x2A\x2A\x2A\x48\x89\xDF"
}
// Called right after "Removed %s(%s)\n"
"UTIL_Remove"
Expand Down
3 changes: 2 additions & 1 deletion src/adminsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,8 @@ CON_COMMAND_CHAT_FLAGS(rcon, "<command> - Send a command to server console", ADM

if (cmdRef.IsValidRef())
{
CCommandContext context(CT_FIRST_SPLITSCREEN_CLIENT, player->GetPlayerSlot());
// Some commands are blocked by UTIL_IsCommandIssuedByServerAdmin which only allows slot -1 on dedicated servers
CCommandContext context(CT_FIRST_SPLITSCREEN_CLIENT, -1);

CCommand newArgs;
newArgs.Tokenize(args.ArgS());
Expand Down
1 change: 1 addition & 0 deletions src/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ CON_COMMAND_CHAT(noshake, "- toggle noshake")
}

CConVar<bool> g_cvarEnableHide("cs2f_hide_enable", FCVAR_NONE, "Whether to enable hide (WARNING: randomly crashes clients since 2023-12-13 CS2 update)", false);
CConVar<bool> g_cvarHideWeapons("cs2f_hide_weapons", FCVAR_NONE, "Whether to hide weapons along with their holders", false);
CConVar<int> g_cvarDefaultHideDistance("cs2f_hide_distance_default", FCVAR_NONE, "The default distance for hide", 250, true, 0, false, 0);
CConVar<int> g_cvarMaxHideDistance("cs2f_hide_distance_max", FCVAR_NONE, "The max distance for hide", 2000, true, 0, false, 0);

Expand Down
1 change: 1 addition & 0 deletions src/commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ extern CConVar<bool> g_cvarEnableStopSound;
extern CConVar<bool> g_cvarEnableNoShake;
extern CConVar<float> g_cvarMaxShakeAmp;
extern CConVar<bool> g_cvarEnableHide;
extern CConVar<bool> g_cvarHideWeapons;

#define CMDFLAG_NONE (0)
#define CMDFLAG_NOHELP (1 << 0) // Don't show in !help menu
Expand Down
15 changes: 15 additions & 0 deletions src/cs2fixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,22 @@ void CS2Fixes::Hook_CheckTransmit(CCheckTransmitInfo** ppInfoList, int infoCount
// Do not hide leaders or item holders to other players
ZEPlayer* pOtherZEPlayer = g_playerManager->GetPlayer(j);
if (pSelfZEPlayer->ShouldBlockTransmit(j) && pOtherZEPlayer && !pOtherZEPlayer->IsLeader() && g_pEWHandler->FindItemInstanceByOwner(j, false, 0) == -1)
{
pInfo->m_pTransmitEntity->Clear(pPawn->entindex());

if (g_cvarHideWeapons.Get())
{
auto pVecWeapons = pPawn->m_pWeaponServices->m_hMyWeapons();

FOR_EACH_VEC(*pVecWeapons, i)
{
auto pWeapon = (*pVecWeapons)[i].Get();

if (pWeapon)
pInfo->m_pTransmitEntity->Clear(pWeapon->entindex());
}
}
}
}

// Don't transmit glow model to it's owner
Expand Down
4 changes: 2 additions & 2 deletions src/zombiereborn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ void CZRPlayerClassManager::LoadPlayerClass()
m_HumanClassMap.insert(std::make_pair(hashKey, pHumanClass));
m_HumanClassKeys.push_back(hashKey);

if (bTeamDefault)
if (bEnabled && bTeamDefault)
m_vecHumanDefaultClass.push_back(pHumanClass);

pHumanClass->PrintInfo();
Expand Down Expand Up @@ -451,7 +451,7 @@ void CZRPlayerClassManager::LoadPlayerClass()
m_ZombieClassMap.insert(std::make_pair(hashKey, pZombieClass));
m_ZombieClassKeys.push_back(hashKey);

if (bTeamDefault)
if (bEnabled && bTeamDefault)
m_vecZombieDefaultClass.push_back(pZombieClass);

pZombieClass->PrintInfo();
Expand Down