diff --git a/.github/workflows/yue_release.yml b/.github/workflows/yue_release.yml index c0925b0..78fc095 100644 --- a/.github/workflows/yue_release.yml +++ b/.github/workflows/yue_release.yml @@ -25,7 +25,7 @@ jobs: - name: Download Yuescript and unzip yue run: | - wget https://github.com/pigpigyyy/Yuescript/releases/download/v0.22.2/yue-linux-x86_64.zip + wget https://github.com/pigpigyyy/Yuescript/releases/download/v0.23.3/yue-linux-x86_64.zip unzip yue-linux-x86_64.zip rm yue-linux-x86_64.zip diff --git a/lua/autorun/!!!random-patches.yue b/lua/autorun/!!!random-patches.yue index f846798..21db66b 100644 --- a/lua/autorun/!!!random-patches.yue +++ b/lua/autorun/!!!random-patches.yue @@ -11,7 +11,7 @@ CLIENT = CLIENT SERVER = SERVER pairs = pairs -addonName = "Random Patches v5.19.0" +addonName = "Random Patches v5.20.0" getHookName = ( patchName, hookName ) -> return addonName .. "::" .. patchName .. ( hookName or "" ) @@ -159,7 +159,7 @@ do yield! -local ENTITY, PLAYER, registry +local registry do -- Just to be safe @@ -170,25 +170,31 @@ do else registry = {} - -- registry indexer with metatable - do + findMetaTable = __findMetaTable + unless isfunction( findMetaTable ) + findMetaTable = FindMetaTable + global __findMetaTable = findMetaTable - FindMetaTable = FindMetaTable - rawset = rawset + setmetatable( registry, { + "__index": ( tbl, key ) -> + metatable = findMetaTable( key ) + if metatable == nil + return - setmetatable( registry, { - "__index": ( tbl, key ) -> - value = FindMetaTable( key ) - if value == nil - return + rawset( tbl, key, metatable ) + return metatable + } ) - rawset( tbl, key, value ) - return value - } ) + -- patched FindMetaTable & debug.getregistry + global FindMetaTable = ( name ) -> + return registry[ name ] debug.getregistry = -> return registry +local ENTITY, PLAYER +do + ENTITY, PLAYER = registry.Entity, registry.Player getCTable = ENTITY.GetCTable @@ -835,9 +841,9 @@ if CLIENT and not MENU_DLL do import OnConVarChanged from cvars + :GetDefault = registry.ConVar GetConVar = GetConVar - :GetDefault = FindMetaTable( "ConVar" ) gameevent.Listen( "server_cvar" ) values = {}