Skip to content
Closed
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
2 changes: 1 addition & 1 deletion regamedll/dlls/weapons.h
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,6 @@ class CC4: public CBasePlayerWeapon
virtual BOOL Deploy();
virtual void Holster(int skiplocal);
virtual void AttachToPlayer(CBasePlayer* pPlayer);
virtual void Think();
virtual float GetMaxSpeed();
virtual int iItemSlot() { return C4_SLOT; }
virtual void PrimaryAttack();
Expand All @@ -884,6 +883,7 @@ class CC4: public CBasePlayerWeapon
#endif
}

void EXPORT TrackPlayerHeldPosition();
Vector GetLastValidHeldPosition() const { return m_vecLastValidPlayerHeldPosition; }

public:
Expand Down
8 changes: 2 additions & 6 deletions regamedll/dlls/wpn_shared/wpn_c4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ void CC4::AttachToPlayer(CBasePlayer* pPlayer)
CBasePlayerWeapon::AttachToPlayer(pPlayer);

#ifdef REGAMEDLL_ADD
SetThink(&CC4::Think);
SetThink(&CC4::TrackPlayerHeldPosition);
pev->nextthink = gpGlobals->time + WEAPON_C4_UPDATE_LAST_VALID_PLAYER_HELD_POSITION_INTERVAL;

if (pPlayer->IsPlayer() && pPlayer->IsAlive())
Expand All @@ -399,9 +399,8 @@ void CC4::AttachToPlayer(CBasePlayer* pPlayer)
#endif
}

void CC4::Think()
void CC4::TrackPlayerHeldPosition()
{
#ifdef REGAMEDLL_ADD
pev->nextthink = gpGlobals->time + WEAPON_C4_UPDATE_LAST_VALID_PLAYER_HELD_POSITION_INTERVAL;

// If the bomb is held by an alive player standing on the ground, then we can use this
Expand All @@ -412,7 +411,4 @@ void CC4::Think()
entvars_t* pevPlayer = m_pPlayer->pev;
m_vecLastValidPlayerHeldPosition = pevPlayer->origin + pevPlayer->mins;
}
#else
CBasePlayerWeapon::Think();
#endif
}