diff --git a/regamedll/dlls/bmodels.cpp b/regamedll/dlls/bmodels.cpp index f79178a6..97bffead 100644 --- a/regamedll/dlls/bmodels.cpp +++ b/regamedll/dlls/bmodels.cpp @@ -252,6 +252,10 @@ void CFuncRotating::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) // REVERSE will cause the it to rotate in the opposite direction. void CFuncRotating::__MAKE_VHOOK(Spawn)() { +#ifdef REGAMEDLL_FIXES + m_angles = pev->angles; +#endif + // set final pitch. Must not be PITCH_NORM, since we // plan on pitch shifting later. m_pitch = PITCH_NORM - 1; @@ -550,6 +554,19 @@ void CFuncRotating::Rotate() pev->nextthink = pev->ltime + 10; } +#ifdef REGAMEDLL_FIXES +void CFuncRotating::Restart() +{ + // fan is spinning, so stop it. + SetThink(&CFuncRotating::SpinDown); + pev->nextthink = pev->ltime + 0.1; + + // restore angles + pev->angles = m_angles; + pev->avelocity = g_vecZero; +} +#endif + // Rotating Use - when a rotating brush is triggered void CFuncRotating::RotatingUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { diff --git a/regamedll/dlls/bmodels.h b/regamedll/dlls/bmodels.h index c32aa2cd..7cf3bcf6 100644 --- a/regamedll/dlls/bmodels.h +++ b/regamedll/dlls/bmodels.h @@ -162,9 +162,13 @@ 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; } + virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_MUST_RESET; } virtual void Blocked(CBaseEntity *pOther); +#ifdef REGAMEDLL_FIXES + virtual void Restart(); +#endif + #ifdef HOOK_GAMEDLL void Spawn_(); @@ -192,6 +196,11 @@ public: float m_flVolume; float m_pitch; int m_sounds; + +#ifdef REGAMEDLL_FIXES + Vector m_angles; +#endif + }; class CPendulum: public CBaseEntity diff --git a/regamedll/dlls/triggers.cpp b/regamedll/dlls/triggers.cpp index 0b03da61..709f2f94 100644 --- a/regamedll/dlls/triggers.cpp +++ b/regamedll/dlls/triggers.cpp @@ -1591,6 +1591,29 @@ void CTriggerPush::__MAKE_VHOOK(Spawn)() UTIL_SetOrigin(pev, pev->origin); } +#ifdef REGAMEDLL_FIXES +void CTriggerPush::Restart() +{ + InitTrigger(); + + if (pev->speed == 0) + { + pev->speed = 100; + } + + // if flagged to Start Turned Off, make trigger nonsolid. + if (pev->spawnflags & SF_TRIGGER_PUSH_START_OFF) + { + pev->solid = SOLID_NOT; + } + + SetUse(&CTriggerPush::ToggleUse); + + // Link into the list + UTIL_SetOrigin(pev, pev->origin); +} +#endif + void CTriggerPush::__MAKE_VHOOK(Touch)(CBaseEntity *pOther) { entvars_t *pevToucher = pOther->pev; @@ -1727,8 +1750,8 @@ void CBuyZone::BuyTouch(CBaseEntity *pOther) #ifdef REGAMEDLL_ADD if (buytime.value == 0.0f) return; -#endif - +#endif + if (!pOther->IsPlayer()) return; diff --git a/regamedll/dlls/triggers.h b/regamedll/dlls/triggers.h index 27a3c72a..673cf161 100644 --- a/regamedll/dlls/triggers.h +++ b/regamedll/dlls/triggers.h @@ -518,6 +518,11 @@ public: virtual void KeyValue(KeyValueData *pkvd); virtual void Touch(CBaseEntity *pOther); +#ifdef REGAMEDLL_FIXES + virtual void Restart(); + virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() | FCAP_MUST_RESET); } +#endif + #ifdef HOOK_GAMEDLL void Spawn_(); @@ -526,6 +531,10 @@ public: #endif +#ifdef REGAMEDLL_FIXES +private: + Vector m_vecAngles; +#endif }; class CTriggerTeleport: public CBaseTrigger diff --git a/regamedll/extra/Toolkit/GameDefinitionFile/regamedll-cs.fgd b/regamedll/extra/Toolkit/GameDefinitionFile/regamedll-cs.fgd index 0f0a843e..f9b6ec62 100644 --- a/regamedll/extra/Toolkit/GameDefinitionFile/regamedll-cs.fgd +++ b/regamedll/extra/Toolkit/GameDefinitionFile/regamedll-cs.fgd @@ -1189,44 +1189,16 @@ @PointClass base(Targetname) = env_fog : "Global Fog Properties" [ - fadein(integer) : "Fade in time" : 0 - holdtime(string) : "Hold time (0 = permanent)" : "0" - fadeout(integer) : "Fade out time" : 0 - startdist(integer) : "Fog start position" : 0 - enddist(integer) : "Fog end position" : 1000 + density(string) : "Fog density" : "0.0005" rendercolor(color255) : "Fog Color (R G B)" : "255 255 255" - spawnflags(flags) = - [ - 1 : "Start active" : 0 - ] ] @PointClass base(Targetname) iconsprite("sprites/CS/env_rain.spr") = env_rain : "rain Properties" [ - fadein(integer) : "Fade in time" : 0 - holdtime(string) : "Hold time (0 = permanent)" : "0" - fadeout(integer) : "Fade out time" : 0 - startdist(integer) : "snow start position" : 0 - enddist(integer) : "rain end position" : 1000 - rendercolor(color255) : "rain Color (R G B)" : "255 255 255" - spawnflags(flags) = - [ - 1 : "Start active" : 0 - ] ] @PointClass base(Targetname) = env_snow : "snow Properties" [ - fadein(integer) : "Fade in time" : 0 - holdtime(string) : "Hold time (0 = permanent)" : "0" - fadeout(integer) : "Fade out time" : 0 - startdist(integer) : "snow start position" : 0 - enddist(integer) : "snow end position" : 1000 - rendercolor(color255) : "snow Color (R G B)" : "255 255 255" - spawnflags(flags) = - [ - 1 : "Start active" : 0 - ] ] @PointClass base(Targetname) = env_lighting : "lightning Properties" diff --git a/regamedll/extra/cssdk/dlls/bmodels.h b/regamedll/extra/cssdk/dlls/bmodels.h index 741ebc69..83ec4781 100644 --- a/regamedll/extra/cssdk/dlls/bmodels.h +++ b/regamedll/extra/cssdk/dlls/bmodels.h @@ -95,6 +95,7 @@ public: // basic functions 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; @@ -107,6 +108,8 @@ public: float m_flVolume; float m_pitch; int m_sounds; + + Vector m_angles; }; class CPendulum: public CBaseEntity { diff --git a/regamedll/extra/cssdk/dlls/triggers.h b/regamedll/extra/cssdk/dlls/triggers.h index e71cb1e5..af790aa9 100644 --- a/regamedll/extra/cssdk/dlls/triggers.h +++ b/regamedll/extra/cssdk/dlls/triggers.h @@ -264,7 +264,9 @@ public: class CTriggerPush: public CBaseTrigger { public: virtual void Spawn() = 0; + virtual void Restart() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; + virtual int ObjectCaps() = 0; virtual void Touch(CBaseEntity *pOther) = 0; };