From 1273a4f68b444969da8d3ab181c32524e6f8e0fc Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Sun, 21 Jun 2026 00:08:47 +0300 Subject: [PATCH] Fix #3631 Fixes #3631 by replacing the local TickQuota value with the global e2_tickquota --- .../gmod_wire_expression2/base/compiler.lua | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/lua/entities/gmod_wire_expression2/base/compiler.lua b/lua/entities/gmod_wire_expression2/base/compiler.lua index b9ff290753..4978286bf3 100644 --- a/lua/entities/gmod_wire_expression2/base/compiler.lua +++ b/lua/entities/gmod_wire_expression2/base/compiler.lua @@ -10,16 +10,8 @@ local Token, TokenVariant = E2Lib.Tokenizer.Token, E2Lib.Tokenizer.Variant local Node, NodeVariant = E2Lib.Parser.Node, E2Lib.Parser.Variant local Operator = E2Lib.Operator local newE2Table = E2Lib.newE2Table - local pairs, ipairs = pairs, ipairs -local TickQuota = GetConVar("wire_expression2_quotatick"):GetInt() - -cvars.RemoveChangeCallback("wire_expression2_quotatick", "compiler_quota_check") -cvars.AddChangeCallback("wire_expression2_quotatick", function(_, old, new) - TickQuota = tonumber(new) -end, "compiler_quota_check") - ---@class ScopeData ---@field dead "ret"|true? ---@field loop boolean? @@ -265,7 +257,7 @@ local CompileVisitors = { if self.scope:ResolveData("loop") or self.scope:ResolveData("switch_case") then -- Inside loop or switch case, check if continued or broken return function(state) ---@param state RuntimeContext state.prf = state.prf + cost - if state.prf > TickQuota then error("perf", 0) end + if state.prf > e2_tickquota then error("perf", 0) end for i = 1, nstmts do state.trace = traces[i] @@ -276,7 +268,7 @@ local CompileVisitors = { elseif self.scope:ResolveData("function") then -- If inside a function, check if returned. return function(state) ---@param state RuntimeContext state.prf = state.prf + cost - if state.prf > TickQuota then error("perf", 0) end + if state.prf > e2_tickquota then error("perf", 0) end for i = 1, nstmts do state.trace = traces[i] @@ -287,7 +279,7 @@ local CompileVisitors = { else -- Most optimized case, not inside a function or loop. return function(state) ---@param state RuntimeContext state.prf = state.prf + cost - if state.prf > TickQuota then error("perf", 0) end + if state.prf > e2_tickquota then error("perf", 0) end for i = 1, nstmts do state.trace = traces[i]