View Single Post
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 10-21-2017 , 10:22   Re: Is worldspawn supposed to be invalid with pev_valid? (or is_valid_ent)
Reply With Quote #4

Well I guess I can answer my own question here
Code:
int is_ent_valid(int iEnt) {     if (iEnt < 1 || iEnt > gpGlobals->maxEntities) // <-- shot in the balls here         return 0;     if (iEnt <= gpGlobals->maxClients)     {         if (!MF_IsPlayerIngame(iEnt))         {             return 0;         }     } else {         if (FNullEnt(TypeConversion.id_to_edict(iEnt)))         {             return 0;         }     }     return 1; }

It still seems weird that 0 is not a valid ent, at least in the scope of this implementation / issue. I'll let you decide on that.

Code:
pev(1, pev_classname, classname, charsmax(classname)); //works fine if player is valid pev(0, pev_classname, classname, charsmax(classname)); //works fine pev(-1, pev_classname, classname, charsmax(classname)); //run time error pev_valid(1) //returns 2 pev_valid(0) //returns 0 pev_valid(-1) //returns 0
seems inconsistent to me
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.

Last edited by aron9forever; 10-21-2017 at 10:28.
aron9forever is offline