Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed the order of setting pev->body for the correct value in SetBo… #893

Merged
merged 1 commit into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion regamedll/dlls/API/CSPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
15 changes: 3 additions & 12 deletions regamedll/dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,6 @@ void EXT_FUNC CBasePlayer::__API_HOOK(GiveDefaultItems)()

void CBasePlayer::RemoveAllItems(BOOL removeSuit)
{
bool bKillProgBar = false;
int i;

#ifdef REGAMEDLL_FIXES
Expand All @@ -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();
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion regamedll/dlls/weapons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")))
Expand Down