Browse Source

Teleport improvements

hlzbot-dirty
mittorn 8 years ago
parent
commit
65871ac312
  1. 15
      dlls/triggers.cpp
  2. 2
      dlls/util.h

15
dlls/triggers.cpp

@ -1837,6 +1837,8 @@ void CBaseTrigger::TeleportTouch( CBaseEntity *pOther ) @@ -1837,6 +1837,8 @@ void CBaseTrigger::TeleportTouch( CBaseEntity *pOther )
entvars_t *pevToucher = pOther->pev;
edict_t *pentTarget = NULL;
if( !(pev->spawnflags & SF_TRIGGER_TELEPORTALL) )
{
// Only teleport monsters or clients
if( !FBitSet( pevToucher->flags, FL_CLIENT | FL_MONSTER ) )
return;
@ -1861,6 +1863,14 @@ void CBaseTrigger::TeleportTouch( CBaseEntity *pOther ) @@ -1861,6 +1863,14 @@ void CBaseTrigger::TeleportTouch( CBaseEntity *pOther )
return;
}
}
}
else
{
if( pOther->IsBSPModel() )
return;
if(pOther == this)
return;
}
pentTarget = FIND_ENTITY_BY_TARGETNAME( pentTarget, STRING( pev->target ) );
if( FNullEnt( pentTarget ) )
@ -1878,7 +1888,9 @@ void CBaseTrigger::TeleportTouch( CBaseEntity *pOther ) @@ -1878,7 +1888,9 @@ void CBaseTrigger::TeleportTouch( CBaseEntity *pOther )
pevToucher->flags &= ~FL_ONGROUND;
UTIL_SetOrigin( pevToucher, tmp );
if( pev->spawnflags & SF_TRIGGER_PORTAL )
pevToucher->angles = pevToucher->angles + pentTarget->v.angles;
else
pevToucher->angles = pentTarget->v.angles;
if( pOther->IsPlayer() )
@ -1887,6 +1899,7 @@ void CBaseTrigger::TeleportTouch( CBaseEntity *pOther ) @@ -1887,6 +1899,7 @@ void CBaseTrigger::TeleportTouch( CBaseEntity *pOther )
}
pevToucher->fixangle = TRUE;
if( !( pev->spawnflags & SF_TRIGGER_PORTAL ) )
pevToucher->velocity = pevToucher->basevelocity = g_vecZero;
}

2
dlls/util.h

@ -459,6 +459,8 @@ extern DLL_GLOBAL int g_Language; @@ -459,6 +459,8 @@ extern DLL_GLOBAL int g_Language;
#define SF_TRIGGER_ALLOWMONSTERS 1// monsters allowed to fire this trigger
#define SF_TRIGGER_NOCLIENTS 2// players not allowed to fire this trigger
#define SF_TRIGGER_PUSHABLES 4// only pushables can fire this trigger
#define SF_TRIGGER_PORTAL 8// apply angles relative
#define SF_TRIGGER_TELEPORTALL 16// teleport all entities
// func breakable
#define SF_BREAK_TRIGGER_ONLY 1// may only be broken by trigger

Loading…
Cancel
Save