Skip to content

Commit

Permalink
Minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lentq committed Jun 21, 2019
1 parent f8b082f commit b669a39
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
18 changes: 10 additions & 8 deletions regamedll/dlls/player.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -9498,6 +9494,12 @@ void CBasePlayer::RemoveBomb()
}
}

void CBasePlayer::RemoveDefuser()
{
m_bHasDefuser = false;
pev->body = 0;
}

void CBasePlayer::Disconnect()
{
SetThink(nullptr);
Expand Down
1 change: 1 addition & 0 deletions regamedll/dlls/player.h
Expand Up @@ -605,6 +605,7 @@ class CBasePlayer: public CBaseMonster {
void DropPrimary();
void OnSpawnEquip(bool addDefault = true, bool equipGame = true);
void RemoveBomb();
void RemoveDefuser();
void HideTimer();
bool MakeBomber();
bool GetIntoGame();
Expand Down

0 comments on commit b669a39

Please sign in to comment.