View Single Post
WhosAsking
Member
Join Date: May 2011
Old 10-18-2013 , 12:32   Re: [ANY] Trigger v1.1
Reply With Quote #4

I was specifically AVOIDING using that because an entity match can match entities of DIFFERENT classes (IOW, the same name may apply to a logic_case and a logic_relay). ent_fire doesn't filter by class, neither does the base event logic system, so mine doesn't filter either. Besides, I don't think FindEntityByClassname works non non-edicts like logic_case, which was one of the problems I had with Trigger Mapentities.

The code you see for finding entities is essentially copied from SMLib, but I avoid using SMLib itself to reduce the overhead, and I can see why they used this technique. It's basically the only way to go.

As for the other code, I'll look at tweaking it.

I'll look into sizeof. My coding base is C, however, and I'd always been taught there that sizeof counts in bytes, which is why it's used in memory operations. My array is of strings and other variable-length constructs which, in my thinking, can throw off sizeof.

Oh, the -2 and -1? Those are defined returns from GetClientAimTarget(), the function I use to aim at an entity. The descriptions I use are based on the API documentation (-1 if no entity is being aimed at. -2 if the function is not supported). GetClientAimTarget is one reason I still use SDKTools.

One last thing: ClassName here is an OUTPUT, meant to report the class of a found entity for reporting (for atypical matching).

Last edited by WhosAsking; 10-18-2013 at 13:11. Reason: Realized where the -2 and -1 come from.
WhosAsking is offline