func_wall_toggle: reset entity on start round

func_wall_toggle features: added spawnflags not solid
Update regamedll-cs.fgd
This commit is contained in:
s1lent 2017-07-02 23:10:00 +07:00
parent 7fddff5198
commit f0409ce468
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C
5 changed files with 34 additions and 0 deletions

View File

@ -68,8 +68,31 @@ void CFuncWallToggle::Spawn()
{
TurnOff();
}
#ifdef REGAMEDLL_ADD
if (pev->spawnflags & SF_WALL_NOTSOLID)
{
pev->solid = SOLID_NOT;
}
#endif
}
#ifdef REGAMEDLL_FIXES
void CFuncWallToggle::Restart()
{
CFuncWall::Spawn();
if (pev->spawnflags & SF_WALL_START_OFF)
{
TurnOff();
return;
}
TurnOn();
}
#endif
void CFuncWallToggle::TurnOff()
{
pev->solid = SOLID_NOT;

View File

@ -58,6 +58,7 @@
// func_wall_toggle
#define SF_WALL_START_OFF 0x0001
#define SF_WALL_NOTSOLID 0x0008
// func_conveyor
#define SF_CONVEYOR_VISUAL 0x0001
@ -85,6 +86,11 @@ public:
virtual void Spawn();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef REGAMEDLL_FIXES
virtual void Restart();
virtual int ObjectCaps() { return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
#endif
public:
void TurnOff();
void TurnOn();

View File

@ -709,6 +709,7 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(CleanUpMap)()
#ifdef REGAMEDLL_FIXES
UTIL_RestartOther("trigger_once");
UTIL_RestartOther("func_wall_toggle");
UTIL_RestartOther("multisource");
UTIL_RestartOther("trigger_auto");
#endif

View File

@ -2717,6 +2717,7 @@
spawnflags(flags) =
[
1 : "Starts Invisible" : 0
8 : "Not Solid" : 0
]
]

View File

@ -53,6 +53,7 @@
// func_wall_toggle
#define SF_WALL_START_OFF 0x0001
#define SF_WALL_NOTSOLID 0x0008
// func_conveyor
#define SF_CONVEYOR_VISUAL 0x0001
@ -71,6 +72,8 @@ public:
class CFuncWallToggle: public CFuncWall {
public:
virtual void Spawn() = 0;
virtual void Restart() = 0;
virtual int ObjectCaps() = 0;
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0;
};