Small fixes (#178)

Reset m_rgRewardAccountRules on CHalfLifeMultiplay()
added missing reward rule RR_TOOK_HOSTAGE
This commit is contained in:
Vaqtincha Oshiq 2017-08-19 22:13:45 +05:00 committed by Dmitry Novikov
parent 8b1be212bf
commit 462dc9986d
3 changed files with 13 additions and 8 deletions

View File

@ -687,7 +687,7 @@ private:
void MarkLivingPlayersOnTeamAsNotReceivingMoneyNextRound(int iTeam);
public:
static RewardAccount m_rgRewardAccountRules[];
static RewardAccount m_rgRewardAccountRules[RR_END];
CVoiceGameMgr m_VoiceGameMgr;
float m_flRestartRoundTime; // The global time when the round is supposed to end, if this is not 0 (deprecated name m_fTeamCount)

View File

@ -920,7 +920,7 @@ void CHostage::GiveCTTouchBonus(CBasePlayer *pPlayer)
m_bTouched = TRUE;
CSGameRules()->m_iAccountCT += CSGameRules()->m_rgRewardAccountRules[RR_TOOK_HOSTAGE_ACC];
pPlayer->AddAccount(REWARD_TOOK_HOSTAGE, RT_HOSTAGE_TOOK);
pPlayer->AddAccount(CSGameRules()->m_rgRewardAccountRules[RR_TOOK_HOSTAGE], RT_HOSTAGE_TOOK);
UTIL_LogPrintf("\"%s<%i><%s><CT>\" triggered \"Touched_A_Hostage\"\n", STRING(pPlayer->pev->netname), GETPLAYERUSERID(pPlayer->edict()), GETPLAYERAUTHID(pPlayer->edict()));
}

View File

@ -12,19 +12,20 @@ cvar_t *sv_clienttrace = NULL;
CCStrikeGameMgrHelper g_GameMgrHelper;
CHalfLifeMultiplay *g_pMPGameRules = nullptr;
RewardAccount CHalfLifeMultiplay::m_rgRewardAccountRules[] = {
REWARD_CTS_WIN, // RR_CTS_WIN
RewardAccount CHalfLifeMultiplay::m_rgRewardAccountRules[RR_END];
RewardAccount m_rgRewardAccountRules_default[] = {
REWARD_CTS_WIN, // RR_CTS_WIN
REWARD_TERRORISTS_WIN, // RR_TERRORISTS_WIN
REWARD_TARGET_BOMB, // RR_TARGET_BOMB
REWARD_VIP_ESCAPED, // RR_VIP_ESCAPED
REWARD_TARGET_BOMB, // RR_TARGET_BOMB
REWARD_VIP_ESCAPED, // RR_VIP_ESCAPED
REWARD_VIP_ASSASSINATED, // RR_VIP_ASSASSINATED
REWARD_TERRORISTS_ESCAPED, // RR_TERRORISTS_ESCAPED
REWARD_CTS_PREVENT_ESCAPE, // RR_CTS_PREVENT_ESCAPE
REWARD_ESCAPING_TERRORISTS_NEUTRALIZED, // RR_ESCAPING_TERRORISTS_NEUTRALIZED
REWARD_ESCAPING_TERRORISTS_NEUTRALIZED, // RR_ESCAPING_TERRORISTS_NEUTRALIZED
REWARD_BOMB_DEFUSED, // RR_BOMB_DEFUSED
REWARD_BOMB_PLANTED, // RR_BOMB_PLANTED
REWARD_BOMB_EXPLODED, // RR_BOMB_EXPLODED
REWARD_ALL_HOSTAGES_RESCUED, // RR_ALL_HOSTAGES_RESCUED
REWARD_ALL_HOSTAGES_RESCUED, // RR_ALL_HOSTAGES_RESCUED
REWARD_TARGET_BOMB_SAVED, // RR_TARGET_BOMB_SAVED
REWARD_HOSTAGE_NOT_RESCUED, // RR_HOSTAGE_NOT_RESCUED
REWARD_VIP_NOT_ESCAPED, // RR_VIP_NOT_ESCAPED
@ -416,6 +417,7 @@ CHalfLifeMultiplay::CHalfLifeMultiplay()
m_VoiceGameMgr.Init(&g_GameMgrHelper, gpGlobals->maxClients);
RefreshSkillData();
Q_memcpy(m_rgRewardAccountRules, m_rgRewardAccountRules_default, sizeof(m_rgRewardAccountRules));
m_flIntermissionEndTime = 0;
m_flIntermissionStartTime = 0;
@ -3504,10 +3506,13 @@ void CHalfLifeMultiplay::ClientDisconnected(edict_t *pClient)
pPlayer->DropPlayerItem("weapon_c4");
}
#ifndef REGAMEDLL_FIXES
// Why ? DropPlayerItem didn't handle item_thighpack
if (pPlayer->m_bHasDefuser)
{
pPlayer->DropPlayerItem("item_thighpack");
}
#endif
if (pPlayer->m_bIsVIP)
{