mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-02-05 10:10:30 +03:00
Fix some things related #231
CGameText: add safe-checks to avoid crash on some maps
This commit is contained in:
parent
565e9cd2b2
commit
cff951afe7
@ -877,7 +877,9 @@ void CRotDoor::Restart()
|
|||||||
// but spawn in the open position
|
// but spawn in the open position
|
||||||
if (pev->spawnflags & SF_DOOR_START_OPEN)
|
if (pev->spawnflags & SF_DOOR_START_OPEN)
|
||||||
{
|
{
|
||||||
#ifndef REGAMEDLL_FIXES
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
pev->angles = m_vecAngle1;
|
||||||
|
#else
|
||||||
pev->angles = m_vecAngle2;
|
pev->angles = m_vecAngle2;
|
||||||
|
|
||||||
Vector vecSav = m_vecAngle1;
|
Vector vecSav = m_vecAngle1;
|
||||||
@ -887,9 +889,11 @@ void CRotDoor::Restart()
|
|||||||
|
|
||||||
pev->movedir = pev->movedir * -1;
|
pev->movedir = pev->movedir * -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef REGAMEDLL_FIXES
|
#ifdef REGAMEDLL_FIXES
|
||||||
pev->angles = m_vecAngle1;
|
else if (pev->netname.IsNull())
|
||||||
|
{
|
||||||
|
pev->angles = m_vecAngle1;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_toggle_state = TS_AT_BOTTOM;
|
m_toggle_state = TS_AT_BOTTOM;
|
||||||
|
@ -181,6 +181,18 @@ void CGameText::KeyValue(KeyValueData *pkvd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CGameText::Spawn()
|
||||||
|
{
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
// Don't allow entity triggering itself
|
||||||
|
if (FStrEq(pev->target, pev->targetname))
|
||||||
|
{
|
||||||
|
ALERT(at_warning, "%s \"%s\" the target applies to itself.\n", STRING(pev->classname), STRING(pev->targetname));
|
||||||
|
pev->target = iStringNull;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void CGameText::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
|
void CGameText::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
|
||||||
{
|
{
|
||||||
if (!CanFireForActivator(pActivator))
|
if (!CanFireForActivator(pActivator))
|
||||||
|
@ -96,6 +96,7 @@ public:
|
|||||||
class CGameText: public CRulePointEntity
|
class CGameText: public CRulePointEntity
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
virtual void Spawn();
|
||||||
virtual void KeyValue(KeyValueData *pkvd);
|
virtual void KeyValue(KeyValueData *pkvd);
|
||||||
virtual int Save(CSave &save);
|
virtual int Save(CSave &save);
|
||||||
virtual int Restore(CRestore &restore);
|
virtual int Restore(CRestore &restore);
|
||||||
|
@ -136,7 +136,7 @@ void FireTargets(const char *targetName, CBaseEntity *pActivator, CBaseEntity *p
|
|||||||
{
|
{
|
||||||
if (g_iTargetRecursionLevel++ > MAX_TARGET_RECURSION_LEVEL)
|
if (g_iTargetRecursionLevel++ > MAX_TARGET_RECURSION_LEVEL)
|
||||||
{
|
{
|
||||||
ALERT(at_warning, "Warning: %s \"%s\" triggered itself over %i times.\n", pCaller->pev->classname.str(), pCaller->pev->targetname.str(), MAX_TARGET_RECURSION_LEVEL);
|
ALERT(at_warning, "%s \"%s\" triggered itself over %i times.\n", pCaller->pev->classname.str(), pCaller->pev->targetname.str(), MAX_TARGET_RECURSION_LEVEL);
|
||||||
g_iTargetRecursionLevel = 0;
|
g_iTargetRecursionLevel = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user