Skip to content

Commit

Permalink
rename method & member
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Shorokhov committed Dec 15, 2022
1 parent 9513084 commit 28e6782
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion regamedll/dlls/addons/trigger_bomb_reset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ void CTriggerBombReset::Touch(CBaseEntity *pOther)
if (pWeaponBox && pWeaponBox->m_bIsBomb)
{
// If the bomb touches this trigger, tell it to reset to its last known valid position.
pWeaponBox->ResetToLastValidPlayerHeldPosition();
pWeaponBox->ResetToLastValidPlayerHeldC4Position();
}
}
2 changes: 1 addition & 1 deletion regamedll/dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8030,7 +8030,7 @@ CBaseEntity *EXT_FUNC CBasePlayer::__API_HOOK(DropPlayerItem)(const char *pszIte
pWeaponBox->m_bIsBomb = true;
pWeaponBox->SetThink(&CWeaponBox::BombThink);
pWeaponBox->pev->nextthink = gpGlobals->time + 1.0f;
pWeaponBox->SetLastValidHeldPosition(((CC4 *)pWeapon)->GetLastValidHeldPosition());
pWeaponBox->SetLastValidHeldC4Position(((CC4 *)pWeapon)->GetLastValidHeldPosition());

if (TheCSBots())
{
Expand Down
6 changes: 3 additions & 3 deletions regamedll/dlls/weapons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2179,14 +2179,14 @@ void CWeaponBox::SetObjectCollisionBox()
pev->absmax = pev->origin + Vector(16, 16, 16);
}

void CWeaponBox::ResetToLastValidPlayerHeldPosition()
void CWeaponBox::ResetToLastValidPlayerHeldC4Position()
{
if (pev->origin == m_vecLastValidPlayerHeldPosition)
if (pev->origin == m_vecLastValidPlayerHeldC4Position)
{
return;
}

Vector const vecResetPos = m_vecLastValidPlayerHeldPosition + Vector(0.0f, 0.0f, 8.0f);
Vector const vecResetPos = m_vecLastValidPlayerHeldC4Position + Vector(0.0f, 0.0f, 8.0f);
Vector const angResetAng = Vector(0.0f, RANDOM_FLOAT(0.0f, 360.0f), 0.0f);

// Teleport
Expand Down
6 changes: 3 additions & 3 deletions regamedll/dlls/weapons.h
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,8 @@ class CWeaponBox: public CBaseEntity
void SetModel_OrigFunc(const char *pszModelName);
#endif

void SetLastValidHeldPosition(const Vector &vecPositon) { m_vecLastValidPlayerHeldPosition = vecPositon; }
void ResetToLastValidPlayerHeldPosition();
void SetLastValidHeldC4Position(const Vector &vecPositon) { m_vecLastValidPlayerHeldC4Position = vecPositon; }
void ResetToLastValidPlayerHeldC4Position();

public:
static TYPEDESCRIPTION m_SaveData[];
Expand All @@ -496,7 +496,7 @@ class CWeaponBox: public CBaseEntity
bool m_bIsBomb;

private:
Vector m_vecLastValidPlayerHeldPosition;
Vector m_vecLastValidPlayerHeldC4Position;
};


Expand Down

0 comments on commit 28e6782

Please sign in to comment.