Skip to content

Commit

Permalink
Only players touch nihilanth portals
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikk155 committed Sep 24, 2024
1 parent b2d79c2 commit a0ce712
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/game/server/entities/NPCs/aliens/nihilanth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1653,14 +1653,19 @@ void CNihilanthHVR::TeleportTouch(CBaseEntity* pOther)
{
CBaseEntity* pEnemy = m_hEnemy;

if (pOther == pEnemy)
if( auto player = ToBasePlayer( pOther ); pOther != nullptr )
{
if (m_hTargetEnt != nullptr)
m_hTargetEnt->Use(pEnemy, pEnemy, USE_ON, 1.0);

if (m_hTouch != nullptr && pEnemy != nullptr)
m_hTouch->Touch(pEnemy);
}
else if( pOther != nullptr && !pOther->ClassNameIs( "worldspawn" ) && !pOther->IsBSPModel() )

Check failure on line 1664 in src/game/server/entities/NPCs/aliens/nihilanth.cpp

View workflow job for this annotation

GitHub Actions / Linux-x86

‘class CBaseEntity’ has no member named ‘ClassNameIs’; did you mean ‘ClassnameIs’?
{
UTIL_Remove( pOther );
return;
}
else
{
m_pNihilanth->MakeFriend(pev->origin);
Expand Down

0 comments on commit a0ce712

Please sign in to comment.