Minor refactoring

This commit is contained in:
s1lent 2019-06-22 03:19:32 +07:00
parent f8b082fece
commit b669a3907a
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C
2 changed files with 11 additions and 8 deletions

View File

@ -1489,8 +1489,7 @@ void CBasePlayer::RemoveAllItems(BOOL removeSuit)
if (m_bHasDefuser)
{
m_bHasDefuser = false;
pev->body = 0;
RemoveDefuser();
MESSAGE_BEGIN(MSG_ONE, gmsgStatusIcon, nullptr, pev);
WRITE_BYTE(STATUSICON_HIDE);
@ -2124,8 +2123,7 @@ void EXT_FUNC CBasePlayer::__API_HOOK(Killed)(entvars_t *pevAttacker, int iGib)
}
else if (m_bHasDefuser)
{
m_bHasDefuser = false;
pev->body = 0;
RemoveDefuser();
#ifdef REGAMEDLL_FIXES
CItemThighPack *pDefuser = (CItemThighPack *)CBaseEntity::Create("item_thighpack", pev->origin, g_vecZero, ENT(pev));
@ -3447,8 +3445,7 @@ void EXT_FUNC CBasePlayer::__API_HOOK(Disappear)()
}
else if (m_bHasDefuser)
{
m_bHasDefuser = false;
pev->body = 0;
RemoveDefuser();
GiveNamedItem("item_thighpack");
MESSAGE_BEGIN(MSG_ONE, gmsgStatusIcon, nullptr, pev);
@ -7794,8 +7791,7 @@ void CBasePlayer::__API_HOOK(SwitchTeam)()
if (m_bHasDefuser)
{
m_bHasDefuser = false;
pev->body = 0;
RemoveDefuser();
MESSAGE_BEGIN(MSG_ONE, gmsgStatusIcon, nullptr, pev);
WRITE_BYTE(STATUSICON_HIDE);
@ -9498,6 +9494,12 @@ void CBasePlayer::RemoveBomb()
}
}
void CBasePlayer::RemoveDefuser()
{
m_bHasDefuser = false;
pev->body = 0;
}
void CBasePlayer::Disconnect()
{
SetThink(nullptr);

View File

@ -605,6 +605,7 @@ public:
void DropPrimary();
void OnSpawnEquip(bool addDefault = true, bool equipGame = true);
void RemoveBomb();
void RemoveDefuser();
void HideTimer();
bool MakeBomber();
bool GetIntoGame();