2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-28 21:10:16 +01:00

engine: client: only check active tempentities when detaching player following tents

This commit is contained in:
Alibek Omarov 2024-11-17 13:38:14 +03:00
parent 56c19c4f5a
commit 622d88eeba

View File

@ -777,25 +777,15 @@ Detach entity from player
*/ */
void GAME_EXPORT R_KillAttachedTents( int client ) void GAME_EXPORT R_KillAttachedTents( int client )
{ {
int i; TEMPENTITY *tent;
if( client <= 0 || client > cl.maxclients ) if( client <= 0 || client > cl.maxclients )
return; return;
for( i = 0; i < GI->max_tents; i++ ) for( tent = cl_active_tents; tent; tent = tent->next )
{ {
TEMPENTITY *pTemp = &cl_tempents[i]; if( FBitSet( tent->flags, FTENT_PLYRATTACHMENT ) && tent->clientIndex == client )
tent->die = cl.time;
if( !FBitSet( pTemp->flags, FTENT_PLYRATTACHMENT ))
continue;
// this TEMPENTITY is player attached.
// if it is attached to this client, set it to die instantly.
if( pTemp->clientIndex == client )
{
// good enough, it will die on next tent update.
pTemp->die = cl.time;
}
} }
} }