EHANDLE
skanks max power cars for sale big tits getting fucked tettone horse dick sex south bend in schools free see through panty galleries dwarf porn take off my bra cumeater jewish single group jacks mannequin tawnee and rachel mormons toby six pack abs highland games scrub uniforms bbk urology cancer dark gothic arts warner brothers bandannas rate my boob job uncensored tv bloopers graduation invitations spring break boobs easy guitar tabs pokemon porn natuerliche zahlen sensual babes skirt and panties off for spanking sun country huge penetrations latter day saints geneology records pocket pc 2003 operating system sex be creative glamour models check printing goverment freemilfs sexpo freedom fuel america new account password madchen amick know nothing los lobos sims bustin out free anime porn clips wrestling nip slips interracial cuckold logo maker ashlee simpson naked sonic the hedgehog porn pedal boat myspace editor lexus fuel injection arkansas arrests hospitality jobs tenacious free fisting pics new york multiple listing oln tv stars nude anime nude free cartoons athletic shoes us calling country codes psychology kiddieporn student loan repayment nursing franchise business opportunities erotic wallpapers ai no kusabi incest cartoon 3d kareena i d go to hell schoolgirl free gallery paris phone number listing kid snow sondra locke couples swapping fax number 10 night life young wet pussy lesbianas tetonas hot boobs wet t shirt teens lcds romantic evening tip cheap package hosting web little april sample videos maxwells models st josephs day table amadoras maternity underwear girls in revealing bikinis bikini girl hells angel super fiesta plaza jdbc definition Entities in the Source Engine are created and deleted all the time. Each time a new entity is instantiated, the engine looks up an unused entity-index and assigns this to the new entity. Once the entity is destroyed, its entity index becomes available again and may be reused for a different entity.
It's often nessary to keep track of an entity. This done mostly with pointers and entindex (index of the entity). However, when the entity is destroyed, using the pointer crashes (because it still points to a non-NULL location) and the entindex is not suitable because it may point to an other entity.
A better and safer way is to use an EHANDLE (or CBaseHandle) to keep track of entities. An EHANDLE encapsulate a 32-bit ID that is unique for an entity instance during the whole game and can be used on both server and client to refer to entity objects (An EHANDLE is a combination of an entity index and an increasing serial number). An EHANDLE can be transformed to CBaseEntity and vice versa just by using its overloaded operators. If an EHANDLE resolves to NULL
, the entity is not valid anymore.
Example
// Find a player, if no player is available pPlayer and hPlayer are NULL CBasePlayer* pPlayer = gEntList.FindEntityByClassname( NULL, "player" ); // Store it in a EHANDLE EHANDLE hPlayer = pPlayer; // Convert back to CBasePlayer pPlayer = dynamic_cast<CBasePlayer*>((CBaseEntity*)hPlayer);
EHANDLEs must always be converted to the class CBaseEntity first, before casting to a derived class.