garrysmod-issues icon indicating copy to clipboard operation
garrysmod-issues copied to clipboard

Really strange behaviour of include function and auto refresh

Open zohart75 opened this issue 6 months ago • 0 comments

Details

Auto refresh works incorrectly when you try to include any gamemode file from non-gamemode file.

Example

  1. Make a custom function for including files in some addon
  2. Call this function for gamemode files from gamemode's init.lua or cl_init.lua
  3. 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 using lua_run include("GAMEMODE_NAME\gamemode\PATH\TO\FILE.lua") WITHOUT gamemodes\ works fine.

Possible Problem

I think that auto refresh uses include with gamemodes\ prefix which causes the error, but include cant see this folder.

zohart75 avatar Aug 27 '24 16:08 zohart75