Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Entities as NPCs

Page: 1 of 1
 VSYoda1
01-20-2004, 1:29 PM
#1
What is the best way to determine if an entity is an NPC? Is it

if (ent->NPC)
{
//is NPC
}
else
{
//isn't NPC
}
 [ONE]Mushroom
01-20-2004, 2:47 PM
#2
That works, so does...
if ( ent->s.eType == ET_NPC )
I seem to have used both in JMMod without any trouble. To be honest, I don't know why you would choose one over the other. Both are used in the SDK, maybe each is used by different programmers.

You might also want (for example)
if ( ent->client->NPC_class == CLASS_VEHICLE )
 VSYoda1
01-20-2004, 3:40 PM
#3
It was more of a curiosity question mostly to see how everyone else does it, thanks for the reply though. :D
Page: 1 of 1