mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-27 07:05:38 +03:00
Fix C4 dissapearance on inclined surfaces with Valve HLDS (#234)
This commit is contained in:
parent
99e54bb5b4
commit
bdf2ddc2d1
@ -1187,6 +1187,10 @@ CGrenade *CGrenade::__API_HOOK(ShootSatchelCharge)(entvars_t *pevOwner, VectorRe
|
|||||||
pGrenade->pev->spawnflags = SF_DETONATE;
|
pGrenade->pev->spawnflags = SF_DETONATE;
|
||||||
|
|
||||||
#ifdef REGAMEDLL_FIXES
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
TraceResult tr;
|
||||||
|
UTIL_TraceLine(vecStart, vecStart + Vector(0, 0, -8192), ignore_monsters, ENT(pevOwner), &tr);
|
||||||
|
pGrenade->pev->oldorigin = (tr.flFraction == 1.0) ? vecStart : tr.vecEndPos;
|
||||||
|
|
||||||
pGrenade->pev->nextthink = gpGlobals->time + 0.01f;
|
pGrenade->pev->nextthink = gpGlobals->time + 0.01f;
|
||||||
#else
|
#else
|
||||||
pGrenade->pev->nextthink = gpGlobals->time + 0.1f;
|
pGrenade->pev->nextthink = gpGlobals->time + 0.1f;
|
||||||
@ -1277,8 +1281,17 @@ void CGrenade::C4Think()
|
|||||||
{
|
{
|
||||||
if (!IsInWorld())
|
if (!IsInWorld())
|
||||||
{
|
{
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
pev->origin = pev->oldorigin;
|
||||||
|
|
||||||
|
if (DROP_TO_FLOOR(edict()) > 0)
|
||||||
|
{
|
||||||
|
pev->velocity = g_vecZero;
|
||||||
|
}
|
||||||
|
#else
|
||||||
UTIL_Remove(this);
|
UTIL_Remove(this);
|
||||||
return;
|
return;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef REGAMEDLL_FIXES
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
@ -106,6 +106,16 @@ void CC4::PrimaryAttack()
|
|||||||
|
|
||||||
int inBombZone = (m_pPlayer->m_signals.GetState() & SIGNAL_BOMB) == SIGNAL_BOMB;
|
int inBombZone = (m_pPlayer->m_signals.GetState() & SIGNAL_BOMB) == SIGNAL_BOMB;
|
||||||
int onGround = (m_pPlayer->pev->flags & FL_ONGROUND) == FL_ONGROUND;
|
int onGround = (m_pPlayer->pev->flags & FL_ONGROUND) == FL_ONGROUND;
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
if (!onGround)
|
||||||
|
{
|
||||||
|
TraceResult tr;
|
||||||
|
UTIL_TraceLine(m_pPlayer->pev->origin, m_pPlayer->pev->origin + Vector(0, 0, -8192), ignore_monsters, m_pPlayer->edict(), &tr);
|
||||||
|
onGround = tr.flFraction != 1.0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool bPlaceBomb = (onGround && inBombZone);
|
bool bPlaceBomb = (onGround && inBombZone);
|
||||||
|
|
||||||
if (!m_bStartedArming)
|
if (!m_bStartedArming)
|
||||||
|
Loading…
Reference in New Issue
Block a user