mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-28 15:45:41 +03:00
Added reset for trigger_hurt and func_pushable (Fixes #64)
This commit is contained in:
parent
084512e267
commit
9a6c46c674
@ -884,6 +884,10 @@ void CPushable::__MAKE_VHOOK(Spawn)()
|
||||
pev->origin.z += 1;
|
||||
UTIL_SetOrigin(pev, pev->origin);
|
||||
|
||||
#ifdef REGAMEDLL_FIXES
|
||||
pev->oldorigin = pev->origin;
|
||||
#endif
|
||||
|
||||
// Multiply by area of the box's cross-section (assume 1000 units^3 standard volume)
|
||||
pev->skin = int((pev->skin * (pev->maxs.x - pev->mins.x) * (pev->maxs.y - pev->mins.y)) * 0.0005);
|
||||
m_soundTime = 0;
|
||||
@ -902,6 +906,30 @@ void CPushable::__MAKE_VHOOK(Precache)()
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef REGAMEDLL_FIXES
|
||||
void CPushable::Restart()
|
||||
{
|
||||
if (pev->spawnflags & SF_PUSH_BREAKABLE)
|
||||
CBreakable::Restart();
|
||||
|
||||
pev->movetype = MOVETYPE_PUSHSTEP;
|
||||
pev->solid = SOLID_BBOX;
|
||||
|
||||
SET_MODEL(ENT(pev), STRING(pev->model));
|
||||
|
||||
if (pev->friction > 399)
|
||||
pev->friction = 399;
|
||||
|
||||
m_soundTime = 0;
|
||||
m_maxSpeed = 400 - pev->friction;
|
||||
|
||||
pev->flags |= FL_FLOAT;
|
||||
pev->friction = 0;
|
||||
|
||||
UTIL_SetOrigin(pev, pev->oldorigin);
|
||||
}
|
||||
#endif
|
||||
|
||||
void CPushable::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
|
||||
{
|
||||
if (FStrEq(pkvd->szKeyName, "size"))
|
||||
|
@ -148,11 +148,15 @@ public:
|
||||
virtual void KeyValue(KeyValueData *pkvd);
|
||||
virtual int Save(CSave &save);
|
||||
virtual int Restore(CRestore &restore);
|
||||
virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_CONTINUOUS_USE; }
|
||||
virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_CONTINUOUS_USE | FCAP_MUST_RESET; }
|
||||
virtual BOOL TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
|
||||
virtual void Touch(CBaseEntity *pOther);
|
||||
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
|
||||
|
||||
#ifdef REGAMEDLL_FIXES
|
||||
virtual void Restart();
|
||||
#endif
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
void Spawn_();
|
||||
|
@ -720,6 +720,13 @@ void CTriggerHurt::__MAKE_VHOOK(Spawn)()
|
||||
UTIL_SetOrigin(pev, pev->origin);
|
||||
}
|
||||
|
||||
#ifdef REGAMEDLL_FIXES
|
||||
void CTriggerHurt::Restart()
|
||||
{
|
||||
Spawn();
|
||||
}
|
||||
#endif
|
||||
|
||||
// trigger hurt that causes radiation will do a radius
|
||||
// check and set the player's geiger counter level
|
||||
// according to distance from center of trigger
|
||||
|
@ -275,6 +275,11 @@ class CTriggerHurt: public CBaseTrigger
|
||||
public:
|
||||
virtual void Spawn();
|
||||
|
||||
#ifdef REGAMEDLL_FIXES
|
||||
virtual void Restart();
|
||||
virtual int ObjectCaps() { return (CBaseTrigger::ObjectCaps() | FCAP_MUST_RESET); }
|
||||
#endif
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
void Spawn_();
|
||||
|
@ -101,6 +101,7 @@ class CPushable: public CBreakable {
|
||||
public:
|
||||
virtual void Spawn() = 0;
|
||||
virtual void Precache() = 0;
|
||||
virtual void Restart() = 0;
|
||||
virtual void KeyValue(KeyValueData *pkvd) = 0;
|
||||
virtual int Save(CSave &save) = 0;
|
||||
virtual int Restore(CRestore &restore) = 0;
|
||||
|
@ -150,6 +150,8 @@ public:
|
||||
class CTriggerHurt: public CBaseTrigger {
|
||||
public:
|
||||
virtual void Spawn() = 0;
|
||||
virtual void Restart() = 0;
|
||||
virtual int ObjectCaps() = 0;
|
||||
};
|
||||
|
||||
class CTriggerMonsterJump: public CBaseTrigger {
|
||||
|
Loading…
Reference in New Issue
Block a user