garrysmod-issues
garrysmod-issues copied to clipboard
Really strange behaviour of include function and auto refresh
Details
Auto refresh works incorrectly when you try to include any gamemode file from non-gamemode file.
Example
- Make a custom function for including files in some addon
- Call this function for gamemode files from gamemode's init.lua or cl_init.lua
- Try refreshing any included file (resaving for example) and you will get this error:
[ERROR] Couldn't include file 'gamemodes\GAMEMODE_NAME\gamemode\PATH\TO\FILE.lua' - File not found or is empty (<nowhere>)
P.s. however usinglua_run include("GAMEMODE_NAME\gamemode\PATH\TO\FILE.lua")
WITHOUTgamemodes\
works fine.
Possible Problem
I think that auto refresh uses include
with gamemodes\
prefix which causes the error, but include
cant see this folder.