View Single Post
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 06-26-2022 , 12:29   Re: GetEntityClassname() and connecting players
Reply With Quote #3

Quote:
Originally Posted by Silvers View Post
Maybe call "IsValidEdict" and use "GetEdictClassname".

Also you should check "channel == SNDCHAN_STATIC" before all the other checks since that consumes the least processing power while the others require more and if the channel is different then you just wasted a bunch of CPU time. I would personally also init the variable as "static char className" so it's not constantly created over and over, sound hooks fire very often.
The topic is about IsValidEntity() not being enough of a check in order to use some of the other functions, but you started it and I will say that stack allocation of arrays should be dirt cheap, no? If it's static, then the plugin will take more runtime space, no?

Edit: Ok, i see this in the sourcepawn transition syntax docs: Also note, there is no equivalent of decl in the new declarator syntax. decl is considered to be dangerous and unnecessary. If an array's zero initialization is too costly, consider making it static or global. .
Maybe decl should have been kept in some way.
__________________
My plugins:
*None for now*


Steam:
naydef

Last edited by Naydef; 06-26-2022 at 13:04.
Naydef is offline