From 1319cd55f70657bf8e4eefa7edea72d708ee5c83 Mon Sep 17 00:00:00 2001 From: Javekson Date: Sat, 11 Nov 2023 17:07:36 +0400 Subject: [PATCH] Changed the order of setting pev->body for the correct value in SetBombIcon() --- regamedll/dlls/API/CSPlayer.cpp | 4 +++- regamedll/dlls/player.cpp | 15 +++------------ regamedll/dlls/weapons.cpp | 2 +- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/regamedll/dlls/API/CSPlayer.cpp b/regamedll/dlls/API/CSPlayer.cpp index e55afd082..219dca12c 100644 --- a/regamedll/dlls/API/CSPlayer.cpp +++ b/regamedll/dlls/API/CSPlayer.cpp @@ -249,11 +249,13 @@ EXT_FUNC CBaseEntity *CCSPlayer::GiveNamedItemEx(const char *pszName) if (FStrEq(pszName, "weapon_c4")) { pPlayer->m_bHasC4 = true; - pPlayer->SetBombIcon(); if (pPlayer->m_iTeam == TERRORIST) { pPlayer->pev->body = 1; } + + pPlayer->SetBombIcon(); + } else if (FStrEq(pszName, "weapon_shield")) { pPlayer->DropPrimary(); pPlayer->DropPlayerItem("weapon_elite"); diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 5e7eed2fc..536d7e5a4 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -1693,7 +1693,6 @@ void EXT_FUNC CBasePlayer::__API_HOOK(GiveDefaultItems)() void CBasePlayer::RemoveAllItems(BOOL removeSuit) { - bool bKillProgBar = false; int i; #ifdef REGAMEDLL_FIXES @@ -1713,20 +1712,12 @@ void CBasePlayer::RemoveAllItems(BOOL removeSuit) { m_bHasC4 = false; pev->body = 0; - - MESSAGE_BEGIN(MSG_ONE, gmsgStatusIcon, nullptr, pev); - WRITE_BYTE(STATUSICON_HIDE); - WRITE_STRING("c4"); - MESSAGE_END(); - - bKillProgBar = true; + SetBombIcon(FALSE); + SetProgressBarTime(0); } RemoveShield(); - if (bKillProgBar) - SetProgressBarTime(0); - if (m_pActiveItem) { ResetAutoaim(); @@ -10359,8 +10350,8 @@ bool EXT_FUNC CBasePlayer::__API_HOOK(MakeBomber)() } m_bHasC4 = true; - SetBombIcon(); pev->body = 1; + SetBombIcon(); m_flDisplayHistory |= DHF_BOMB_RETRIEVED; HintMessage("#Hint_you_have_the_bomb", FALSE, TRUE); diff --git a/regamedll/dlls/weapons.cpp b/regamedll/dlls/weapons.cpp index 2d5b5ed57..3baa8a44e 100644 --- a/regamedll/dlls/weapons.cpp +++ b/regamedll/dlls/weapons.cpp @@ -1920,8 +1920,8 @@ void CWeaponBox::Touch(CBaseEntity *pOther) MESSAGE_END(); pPlayer->m_bHasC4 = true; - pPlayer->SetBombIcon(FALSE); pPlayer->pev->body = 1; + pPlayer->SetBombIcon(FALSE); CBaseEntity *pEntity = nullptr; while ((pEntity = UTIL_FindEntityByClassname(pEntity, "player")))