Fix short loop on func_train

This commit is contained in:
mittorn 2018-08-14 00:05:26 +07:00
parent ba1729708b
commit b747a52f79
2 changed files with 7 additions and 1 deletions

View File

@ -1234,7 +1234,7 @@ we could also use the pas/ pvs that we set in SetupVisibility, if we wanted to.
int AddToFullPack( struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet )
{
int i;
static int counter; // XASH3DMAX_VISIBLE_PACKET == 512
static int counter; // XASH3D MAX_VISIBLE_PACKET == 512
bool hide = false;
if( ( ent == host || player ) && counter > gpGlobals->maxClients + 1 )

View File

@ -736,6 +736,12 @@ void CFuncTrain::Next( void )
return;
}
if( pTarg->GetNextTarget() == pTarg )
{
ALERT(at_error, "train short loop!");
return;
}
// Save last target in case we need to find it again
pev->message = pev->target;