I am currently working on a HUD for my custom gamemode, but i have run into some trouble.
After some time (this is usually random), my HUD suddenly stops functioning and spams lua errors. This is the error to be Exact:
[ERROR] lua/includes/util/client.lua:135: Tried to use a NULL entity! 1. GetRenderBounds - [C]:-1 2. PositionSpawnIcon - lua/includes/util/client.lua:135 3. DrawCircularCustomHud - gamemodes/fc3dm/gamemode/hud/cl_hud.lua:119 4. DrawHUD - gamemodes/fc3dm/gamemode/hud/cl_hud.lua:237 5. unknown - gamemodes/fc3dm/gamemode/hud/cl_hud.lua:245
The hud is this one:
The hud uses some code from older garrysmod 12 huds, which may be why the errors are happening. But i cannot pinpoint the cause of it. Any help?