Closed ExtReMLapin closed 5 years ago
The point of "analyze globals" is to get an insight into what globals you are creating and what globals you're referencing. Seeing variables like ply
, i
, k
or v
in there gives a good hint that you're forgetting the keyword local
, or are using undeclared variables. Those could cause some nasty bugs that don't necessarily throw errors.
I'll look at the error later.
The bug's been fixed.
I ran the tool on DarkRP, and besides a LOT of globals that were intended to be global, I found these in the list:
- Offset
...\GarrysMod\garrysmod\gamemodes\DarkRP\entities\weapons\weapon_cs_base2\shared.lua:
line 317, column 13 - line 317, column 19
- Right
...\GarrysMod\garrysmod\gamemodes\DarkRP\entities\weapons\weapon_cs_base2\shared.lua:
line 318, column 13 - line 318, column 18
- Forward
...\GarrysMod\garrysmod\gamemodes\DarkRP\entities\weapons\weapon_cs_base2\shared.lua:
line 319, column 13 - line 320, column 15
- Up
...\GarrysMod\garrysmod\gamemodes\DarkRP\entities\weapons\weapon_cs_base2\shared.lua:
line 319, column 13 - line 319, column 15
Those variables being global is a bug, so I fixed it. In this case it wouldn't cause problems, but imagine some caps error somewhere else using one of those var names undeclared/undefined. It'll work on your PC sometimes, but sometimes not. Sometimes it'll work for you, but not for other people. Very nasty. I vaguely remember having to deal with such bugs. Those were dreadful days.
Thanks for the fix, interesting, in the garrysmod github repo there is around 443 globals
221 are from the TTT gamemode
Hello, when trying to analyse globals (Idk what's the point exactly)
I get this error in the console
"Lint project" works correctly.