Skip to content

Commit

Permalink
Pass through more required functions (#52)
Browse files Browse the repository at this point in the history
* Pass through more required functions

* Missed two
  • Loading branch information
Doridian authored Mar 3, 2024
1 parent 9038c87 commit ab6d244
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lua/entities/gmod_wire_gpu/cl_gpuvm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down
11 changes: 11 additions & 0 deletions lua/wire/zvm/zvm_core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ab6d244

Please sign in to comment.