mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-26 14:45:38 +03:00
Disable buyicon/buymenu according to info_map_parameters (#205)
This commit is contained in:
parent
8c9ee510bb
commit
022115cc35
@ -667,6 +667,7 @@ public:
|
||||
|
||||
// has a style of gameplay when aren't any teams
|
||||
bool IsFreeForAll() const;
|
||||
bool CanPlayerBuy(CBasePlayer *pPlayer) const;
|
||||
|
||||
VFUNC bool HasRoundTimeExpired();
|
||||
VFUNC bool IsBombPlanted();
|
||||
|
@ -4928,3 +4928,21 @@ void CHalfLifeMultiplay::ChangePlayerTeam(CBasePlayer *pPlayer, const char *pTea
|
||||
CSGameRules()->CheckWinConditions();
|
||||
}
|
||||
}
|
||||
|
||||
bool CHalfLifeMultiplay::CanPlayerBuy(CBasePlayer *pPlayer) const
|
||||
{
|
||||
if (pPlayer->m_iTeam == CT && m_bCTCantBuy)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (pPlayer->m_iTeam == TERRORIST && m_bTCantBuy)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (m_bCTCantBuy && m_bTCantBuy)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -6154,11 +6154,21 @@ void OLD_CheckBuyZone(CBasePlayer *player)
|
||||
{
|
||||
const char *pszSpawnClass = nullptr;
|
||||
|
||||
if (player->m_iTeam == TERRORIST)
|
||||
pszSpawnClass = "info_player_deathmatch";
|
||||
#ifdef REGAMEDLL_FIXES
|
||||
if (!CSGameRules()->CanPlayerBuy(player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (player->m_iTeam == TERRORIST)
|
||||
{
|
||||
pszSpawnClass = "info_player_deathmatch";
|
||||
}
|
||||
else if (player->m_iTeam == CT)
|
||||
{
|
||||
pszSpawnClass = "info_player_start";
|
||||
}
|
||||
|
||||
if (pszSpawnClass)
|
||||
{
|
||||
|
@ -1812,6 +1812,11 @@ void CBuyZone::BuyTouch(CBaseEntity *pOther)
|
||||
|
||||
if (pev->team == UNASSIGNED || pev->team == p->m_iTeam)
|
||||
{
|
||||
#ifdef REGAMEDLL_FIXES
|
||||
if (!CSGameRules()->CanPlayerBuy(p))
|
||||
return;
|
||||
#endif
|
||||
|
||||
p->m_signals.Signal(SIGNAL_BUY);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user