nosoop / SM-TFAttributeSupport

A SourceMod plugin that improves support for official TF2 attributes.
GNU General Public License v3.0
12 stars 4 forks source link

Add fake client check to CalculateMaxSpeed #23

Closed M60TM closed 1 year ago

M60TM commented 1 year ago
L 09/03/2023 - 19:55:19: [SM] Exception reported: Entity 22 (22) is invalid
L 09/03/2023 - 19:55:19: [SM] Blaming: tf2attribute_support.smx
L 09/03/2023 - 19:55:19: [SM] Call stack trace:
L 09/03/2023 - 19:55:19: [SM]   [0] GetEntPropEnt
L 09/03/2023 - 19:55:19: [SM]   [1] Line 587, C:\suspawn\mystuff_7040\scripting\tf2attribute_support.sp::OnPlayerCalculateMaxSpeedPost

This error also is occurred in SM 1.11. It seems to enough adding index check.

nosoop commented 1 year ago

22 should be within the MaxClients range, so I'd be surprised if your range check works there unless you have a really low player limit set.

M60TM commented 1 year ago

I got that error log on 33 max player server. It works, but I still don't know how that work. maybe I need more test.

M60TM commented 1 year ago

After test, I found some interesting points.

  1. It is appeared when map change with "bot". (I don't know why it is appeared in server that doesn't have bots.)
  2. IsValidEntity can't fix this problem.
  3. client index check can't fix this problem.
  4. I added IsFakeClient check, it fixed.

As a result, this error seems to be related with bots.

M60TM commented 1 year ago

I can't find a way to solve this. I'll try again later when I get a clearer clue.