From ab6d244bc2b0929b3a03f1e1e5b5fa38c3b8e471 Mon Sep 17 00:00:00 2001 From: Mark Dietzer Date: Sun, 3 Mar 2024 05:23:55 -0800 Subject: [PATCH] Pass through more required functions (#52) * Pass through more required functions * Missed two --- lua/entities/gmod_wire_gpu/cl_gpuvm.lua | 6 ++++++ lua/wire/zvm/zvm_core.lua | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/lua/entities/gmod_wire_gpu/cl_gpuvm.lua b/lua/entities/gmod_wire_gpu/cl_gpuvm.lua index ca678b6..a672fba 100644 --- a/lua/entities/gmod_wire_gpu/cl_gpuvm.lua +++ b/lua/entities/gmod_wire_gpu/cl_gpuvm.lua @@ -38,6 +38,12 @@ function ENT:OverrideVM() self.VM.Env["render"] = { CopyTexture = render.CopyTexture } + self.VM.Env["string"] = { + sub = string.sub, + len = string.len + } + self.VM.Env["tostring"] = tostring + self.VM.Env["tonumber"] = tonumber self.VM.Env["WireGPU_matBuffer"] = WireGPU_matBuffer self.VM.ErrorText = {} diff --git a/lua/wire/zvm/zvm_core.lua b/lua/wire/zvm/zvm_core.lua index 6d41da0..60aa513 100644 --- a/lua/wire/zvm/zvm_core.lua +++ b/lua/wire/zvm/zvm_core.lua @@ -707,12 +707,23 @@ end ZVM.Env = { math={ Clamp = math.Clamp, + Round = math.Round, floor = math.floor, + ceil = math.ceil, + fmod = math.fmod, min = math.min, max = math.max, + mod = math.mod, sqrt = math.sqrt, sin = math.sin, cos = math.cos, + tan = math.tan, + asin = math.asin, + acos = math.acos, + atan = math.atan, + log = math.log, + log10 = math.log10, + exp = math.exp, pi = math.pi, abs = math.abs, random = math.random