FortyTwoFortyTwo / Randomizer

TF2 plugin that randomizes player loadout in any imaginable combinations
GNU General Public License v3.0
35 stars 15 forks source link

Fix some code runs when plugin is disabled. #120

Closed HotoCocoaco closed 3 months ago

HotoCocoaco commented 4 months ago

I was getting errors like when randomizer_enabled is 0. There are no g_bEnabled check for these functions or even more. I have fixed the cases that I encountered.

L 05/14/2024 - 23:37:42: [SM] Exception reported: Exceeded array limit on storing class, enable randomizer_debug and try again for more infos
L 05/14/2024 - 23:37:42: [SM] Blaming: randomizer.smx
L 05/14/2024 - 23:37:42: [SM] Call stack trace:
L 05/14/2024 - 23:37:42: [SM]   [0] ThrowError
L 05/14/2024 - 23:37:42: [SM]   [1] Line 923, randomizer.sp::SetClientClass
L 05/14/2024 - 23:37:42: [SM]   [2] Line 822, randomizer.sp::Console_EurekaTeleport
L 05/12/2024 - 15:26:07: [SM] Exception reported: Entity -1 (-1) is invalid
L 05/12/2024 - 15:26:07: [SM] Blaming: randomizer.smx
L 05/12/2024 - 15:26:07: [SM] Call stack trace:
L 05/12/2024 - 15:26:07: [SM]   [0] GetEntProp
L 05/12/2024 - 15:26:07: [SM]   [1] Line 539, randomizer.sp::OnGameFrame

edit: add more g_bEnabled check.