Skip to content
Open
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
25 changes: 10 additions & 15 deletions regamedll/dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8390,21 +8390,6 @@ void CBasePlayer::__API_HOOK(SwitchTeam)()
if (m_bHasDefuser)
{
RemoveDefuser();

#ifndef REGAMEDLL_FIXES
// NOTE: unreachable code - Vaqtincha
for (int i = 0; i < MAX_ITEM_TYPES; i++)
{
m_pActiveItem = m_rgpPlayerItems[i];

if (m_pActiveItem && FClassnameIs(m_pActiveItem->pev, "item_thighpack"))
{
m_pActiveItem->Drop();
m_rgpPlayerItems[i] = nullptr;
}
}
#endif

}

szOldTeam = GetTeam(oldTeam);
Expand Down Expand Up @@ -8439,6 +8424,16 @@ void CBasePlayer::__API_HOOK(SwitchTeam)()
// Initialize the player counts now that a player has switched teams
int NumDeadCT, NumDeadTerrorist, NumAliveTerrorist, NumAliveCT;
CSGameRules()->InitializePlayerCounts(NumAliveTerrorist, NumAliveCT, NumDeadTerrorist, NumDeadCT);

if (m_bHasC4)
{
if (NumAliveTerrorist > 0 && CSPlayer()->RemovePlayerItemEx("weapon_c4", true)) {
CSGameRules()->GiveC4();
}
else {
DropPlayerItem("weapon_c4");
}
}
#endif
}

Expand Down