-- [ Picked text/plain from multipart/alternative ] Thank you!
On 11/29/05, Yahn Bernier <[EMAIL PROTECTED]> wrote: > > edict_t *pEdict = xxx; > CGameRules *rules = dynamic_cast< CGameRules * >( CBaseEntity::Instance( > pEdict ) ); > if ( rules ) > { > // stuff > } > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of LDuke > Sent: Tuesday, November 29, 2005 2:01 PM > To: hlcoders@list.valvesoftware.com > Subject: Re: [hlcoders] LINK_ENTITY_TO_CLASS > > -- > [ Picked text/plain from multipart/alternative ] > I already have the edict_t* for the instance of "my_gamerules." I'm > trying > to obtain the CGameRules* from that. > > Maybe I just can't do it that way. > > Anyway, thanks for the previous responses. > > L. Duke > > > On 11/29/05, Jay Stelly <[EMAIL PROTECTED]> wrote: > > > > LINK_ENTITY_TO_CLASS creates a factory for entities of that type. So > it > > tells the code how to create a CGameRules object when the bsp contains > > an entity with a classname of "my_gamerules". There isn't necessarily > > only one entity of a given class (though there should be for > gamerules). > > Anyway, you can always use the entity list find functions in > > entitylist.h (FindEntityByClassname or NextEntByClass are the two most > > likely functions for you to use). > > > > Jay > > > > > > > -----Original Message----- > > > From: [EMAIL PROTECTED] > > > [mailto:[EMAIL PROTECTED] On Behalf Of LDuke > > > Sent: Tuesday, November 29, 2005 12:31 PM > > > To: hlcoders@list.valvesoftware.com > > > Subject: [hlcoders] LINK_ENTITY_TO_CLASS > > > > > > -- > > > [ Picked text/plain from multipart/alternative ] If an entity > > > and class are linked using LINK_ENTITY_TO_CLASS(EntityName, > > > ClassName ), how can I later get the class pointer for an entity? > > > > > > For example, if I have LINK_ENTITY_TO_CLASS(my_gamerules, > > > CGameRules), I want to find the CGameRules* for the instance > > > of the my_gamerules entity. > > > > > > L. Duke > > > -- > > > > > > _______________________________________________ > > > To unsubscribe, edit your list preferences, or view the list > > > archives, please visit: > > > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > > > > > > > > > _______________________________________________ > > To unsubscribe, edit your list preferences, or view the list archives, > > please visit: > > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > > > > -- > > _______________________________________________ > To unsubscribe, edit your list preferences, or view the list archives, > please visit: > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > > _______________________________________________ > To unsubscribe, edit your list preferences, or view the list archives, > please visit: > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > -- _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders