mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-27 14:08:00 +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
|
||||
if (pev->spawnflags & SF_DOOR_START_OPEN)
|
||||
{
|
||||
#ifndef REGAMEDLL_FIXES
|
||||
#ifdef REGAMEDLL_FIXES
|
||||
pev->angles = m_vecAngle1;
|
||||
#else
|
||||
pev->angles = m_vecAngle2;
|
||||
|
||||
Vector vecSav = m_vecAngle1;
|
||||
@ -887,9 +889,11 @@ void CRotDoor::Restart()
|
||||
|
||||
pev->movedir = pev->movedir * -1;
|
||||
}
|
||||
|
||||
#ifdef REGAMEDLL_FIXES
|
||||
pev->angles = m_vecAngle1;
|
||||
else if (pev->netname.IsNull())
|
||||
{
|
||||
pev->angles = m_vecAngle1;
|
||||
}
|
||||
#endif
|
||||
|
||||
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)
|
||||
{
|
||||
if (!CanFireForActivator(pActivator))
|
||||
|
@ -96,6 +96,7 @@ public:
|
||||
class CGameText: public CRulePointEntity
|
||||
{
|
||||
public:
|
||||
virtual void Spawn();
|
||||
virtual void KeyValue(KeyValueData *pkvd);
|
||||
virtual int Save(CSave &save);
|
||||
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)
|
||||
{
|
||||
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;
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user