View Single Post
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 07-30-2021 , 10:18   Re: [L4D2]Exception reported: Client index 0 is invalid
Reply With Quote #7

Quote:
Originally Posted by dustinandband View Post
Had anyone seen a client index above the MacClients value? Just asking here cause I never check if a client index is below 32 and haven’t had any errors about that over the years, but wondering why it’s a common practice to check.
I've seen client indexes having negative values and very high values (up to 5 digits) before. You can usually get those kinds of values when passing/using entity indexes without validating that they are actually client indexes. For example, in OnTakeDamage, sometimes the inflictor (entity index) can also be the attacker, so when you only check "attacker > 0" it will return true for the inflictor's index, thus resulting in an "Invalid client index" error.
__________________
Psyk0tik is offline