Localize accidental globals

This commit is contained in:
Redox 2023-09-20 18:48:04 +02:00
parent 9498e7330e
commit 3cba7a64b8
No known key found for this signature in database
GPG Key ID: C10A433A95068388
3 changed files with 10 additions and 10 deletions

View File

@ -747,8 +747,9 @@ function PART:SetAlternativeScaling(b)
end
function PART:SetScale(vec)
max_scale = GetConVar("pac_model_max_scales"):GetFloat()
largest_scale = math.max(math.abs(vec.x), math.abs(vec.y), math.abs(vec.z))
local max_scale = GetConVar("pac_model_max_scales"):GetFloat()
local largest_scale = math.max(math.abs(vec.x), math.abs(vec.y), math.abs(vec.z))
if vec and max_scale > 0 and (LocalPlayer() ~= self:GetPlayerOwner()) then --clamp for other players if they have pac_model_max_scales convar more than 0
vec = Vector(math.Clamp(vec.x, -max_scale, max_scale), math.Clamp(vec.y, -max_scale, max_scale), math.Clamp(vec.z, -max_scale, max_scale))
end

View File

@ -344,10 +344,10 @@ end
PART.Inputs.part_distance = function(self, uid1, uid2)
if not uid1 or not uid2 then return 0 end
PartA = pac.GetPartFromUniqueID(pac.Hash(pac.LocalPlayer), uid1)
local PartA = pac.GetPartFromUniqueID(pac.Hash(pac.LocalPlayer), uid1)
if not PartA:IsValid() then PartA = pac.FindPartByName(pac.Hash(pac.LocalPlayer), uid1, self) end
PartB = pac.GetPartFromUniqueID(pac.Hash(pac.LocalPlayer), uid2)
local PartB = pac.GetPartFromUniqueID(pac.Hash(pac.LocalPlayer), uid2)
if not PartB:IsValid() then PartB = pac.FindPartByName(pac.Hash(pac.LocalPlayer), uid2, self) end
if not PartA:IsValid() or not PartB:IsValid() then return 0 end
@ -357,7 +357,7 @@ end
PART.Inputs.event_alternative = function(self, uid1, num1, num2)
if not uid1 then return 0 end
PartA = pac.GetPartFromUniqueID(pac.Hash(pac.LocalPlayer), uid1)
local PartA = pac.GetPartFromUniqueID(pac.Hash(pac.LocalPlayer), uid1)
if not PartA:IsValid() then PartA = pac.FindPartByName(pac.Hash(pac.LocalPlayer), uid1, self) end
if PartA.ClassName == "event" then
@ -631,10 +631,9 @@ PART.Inputs.pose_parameter_true = function(self, name)
if not name then return 0 end
local owner = get_owner(self)
if owner:IsValid() then
min,max = owner:GetPoseParameterRange(owner:LookupPoseParameter(name))
actual_value = min + (max - min)*(owner:GetPoseParameter(name))
return actual_value
else end
local min, max = owner:GetPoseParameterRange(owner:LookupPoseParameter(name))
return min + (max - min)*(owner:GetPoseParameter(name))
end
return 0
end

View File

@ -29,7 +29,7 @@ pac.AddHook("RenderScene", "webaudio_3d", function(position, angle)
end)
webaudio.Streams.STREAM = {}
STREAM = webaudio.Streams.STREAM
local STREAM = webaudio.Streams.STREAM
STREAM.__index = STREAM
-- Identity