diff --git a/lua/pac3/core/client/parts/animation.lua b/lua/pac3/core/client/parts/animation.lua index 4af1191a..9c2e973e 100644 --- a/lua/pac3/core/client/parts/animation.lua +++ b/lua/pac3/core/client/parts/animation.lua @@ -16,7 +16,7 @@ AnimStack = { local top = self:getTop() if top ~= part then if top then top:OnStackStop() end - + -- Remove self from stack to move to end and also prevent things from breaking because table.RemoveByValue() only removes the first instance table.RemoveByValue(stack, part) table.insert(stack, part) @@ -28,7 +28,7 @@ AnimStack = { pop = function(self, part) part:OnStackStop() local stack = self.stack - + -- Remove self from animation stack if table.RemoveByValue(stack, part) == #stack + 1 then -- This was the current animation so play the next in the stack diff --git a/lua/pac3/core/client/parts/beam.lua b/lua/pac3/core/client/parts/beam.lua index 835854a5..ab83b816 100644 --- a/lua/pac3/core/client/parts/beam.lua +++ b/lua/pac3/core/client/parts/beam.lua @@ -200,7 +200,7 @@ end function PART:OnDraw() local part = self.EndPoint - + if self.Materialm and self.StartColorC and self.EndColorC and part:IsValid() and part.GetWorldPosition then local pos, ang = self:GetDrawPosition() render.SetMaterial(self.Materialm) diff --git a/lua/pac3/core/client/parts/event.lua b/lua/pac3/core/client/parts/event.lua index ae785353..4673a301 100644 --- a/lua/pac3/core/client/parts/event.lua +++ b/lua/pac3/core/client/parts/event.lua @@ -35,12 +35,12 @@ BUILDER:StartStorableVars() BUILDER:EndStorableVars() function PART:SetEvent(event) - local reset = (self.Arguments == "") or + local reset = (self.Arguments == "") or (self.Arguments ~= "" and self.Event ~= "" and self.Event ~= event) self.Event = event self:SetWarning() - self:GetDynamicProperties(reset) + self:GetDynamicProperties(reset) end local function get_default(typ) @@ -95,8 +95,8 @@ function PART:GetDynamicProperties(reset_to_default) } local arg = tbl[key] - if arg.get() == nil or reset_to_default then - if udata.default then + if arg.get() == nil or reset_to_default then + if udata.default then arg.set(udata.default) else arg.set(nil) @@ -824,8 +824,8 @@ PART.OldEvents = { command = { arguments = {{find = "string"}, {time = "number"}, {hide_in_eventwheel = "boolean"}}, userdata = { - {default = "change_me", editor_friendly = "CommandName"}, - {default = 0.1, editor_friendly = "EventDuration"}, + {default = "change_me", editor_friendly = "CommandName"}, + {default = 0.1, editor_friendly = "EventDuration"}, {default = false, group = "event wheel", editor_friendly = "HideInEventWheel"} }, nice = function(self, ent, find, time) diff --git a/lua/pac3/core/client/parts/legacy/sound.lua b/lua/pac3/core/client/parts/legacy/sound.lua index feb0011c..8cd06b10 100644 --- a/lua/pac3/core/client/parts/legacy/sound.lua +++ b/lua/pac3/core/client/parts/legacy/sound.lua @@ -185,9 +185,9 @@ function PART:PlaySound(osnd, ovol) if #sounds > 1 then if self.Sequential then self.seq_index = self.seq_index or 1 - + snd = sounds[self.seq_index] - + self.seq_index = self.seq_index + self.SequentialStep self.seq_index = self.seq_index % (#sounds+1) if self.seq_index == 0 then self.seq_index = 1 end @@ -212,7 +212,7 @@ function PART:PlaySound(osnd, ovol) "(%[%d-,%d-%])",self.seq_index ) self.seq_index = self.seq_index + self.SequentialStep - + local span = minmaxpath(self.Sound,"max") - minmaxpath(self.Sound,"min") + 1 if self.seq_index > minmaxpath(self.Sound,"max") then self.seq_index = self.seq_index - span diff --git a/lua/pac3/core/client/parts/model/entity.lua b/lua/pac3/core/client/parts/model/entity.lua index af3da871..79383844 100644 --- a/lua/pac3/core/client/parts/model/entity.lua +++ b/lua/pac3/core/client/parts/model/entity.lua @@ -168,11 +168,11 @@ function PART:OnShow() end end - if not self.real_model then - self.real_model = ent:GetModel() + if not self.real_model then + self.real_model = ent:GetModel() end - if not (self.old_model == self:GetModel()) or + if not (self.old_model == self:GetModel()) or (pac.LocalHands:IsValid() and ent == pac.LocalHands and not (self.real_model == pac.LocalHands:GetModel())) then self.old_model = self:GetModel() diff --git a/lua/pac3/core/client/parts/particles.lua b/lua/pac3/core/client/parts/particles.lua index 81c0f1e4..0ef3a2ce 100644 --- a/lua/pac3/core/client/parts/particles.lua +++ b/lua/pac3/core/client/parts/particles.lua @@ -356,7 +356,7 @@ function PART:EmitParticles(pos, ang, real_ang) end end - + self.NextShot = pac.RealTime + self.FireDelay end self.FirstShot = false diff --git a/lua/pac3/core/client/parts/proxy.lua b/lua/pac3/core/client/parts/proxy.lua index 4fbc8a59..778435c1 100644 --- a/lua/pac3/core/client/parts/proxy.lua +++ b/lua/pac3/core/client/parts/proxy.lua @@ -307,7 +307,7 @@ PART.Inputs.random_once = function(self, seed, min, max) self.rand_id = self.rand_id or {} if seed then self.rand_id[seed] = self.rand_id[seed] or min + math.random()*(max-min) - else + else self.rand = self.rand or min + math.random()*(max-min) end diff --git a/lua/pac3/core/server/test_suite_backdoor.lua b/lua/pac3/core/server/test_suite_backdoor.lua index 29411b38..9913cacf 100644 --- a/lua/pac3/core/server/test_suite_backdoor.lua +++ b/lua/pac3/core/server/test_suite_backdoor.lua @@ -8,7 +8,7 @@ util.AddNetworkString("pac3_test_suite_backdoor") net.Receive("pac3_test_suite_backdoor", function(len, ply) -- needs to be enabled through lua first, eg lua_run pac.test_suite_backdoor_enabled = true if not pac.test_suite_backdoor_enabled then return end - + -- need to be at least super admin if not ply:IsSuperAdmin() then return end diff --git a/lua/pac3/core/shared/footsteps_fix.lua b/lua/pac3/core/shared/footsteps_fix.lua index 0b4b9410..8440073a 100644 --- a/lua/pac3/core/shared/footsteps_fix.lua +++ b/lua/pac3/core/shared/footsteps_fix.lua @@ -4,11 +4,11 @@ if game.SinglePlayer() then util.AddNetworkString('pac_footstep') util.AddNetworkString('pac_footstep_request_state_update') util.AddNetworkString('pac_signal_mute_footstep') - + hook.Add("PlayerFootstep", "footstep_fix", function(ply, pos, _, snd, vol) net.Start("pac_footstep_request_state_update") net.Send(ply) - + net.Start("pac_footstep") net.WriteEntity(ply) net.WriteVector(pos) @@ -16,7 +16,7 @@ if game.SinglePlayer() then net.WriteFloat(vol) net.Broadcast() end) - + net.Receive("pac_signal_mute_footstep", function(len,ply) local b = net.ReadBool() ply.pac_mute_footsteps = b @@ -26,8 +26,8 @@ if game.SinglePlayer() then end) else hook.Remove("PlayerFootstep", "pac_footstep_silence") end end) - - + + end if CLIENT then diff --git a/lua/pac3/editor/client/examples.lua b/lua/pac3/editor/client/examples.lua index d6b399c2..9733103e 100644 --- a/lua/pac3/editor/client/examples.lua +++ b/lua/pac3/editor/client/examples.lua @@ -2555,7 +2555,7 @@ pace.example_outfits["southpark"] = { ["Duplicate"] = false, ["ClassName"] = "group", }, - }, + }, } diff --git a/lua/pac3/editor/client/panels/extra_properties.lua b/lua/pac3/editor/client/panels/extra_properties.lua index 48e9dcec..fb2283d5 100644 --- a/lua/pac3/editor/client/panels/extra_properties.lua +++ b/lua/pac3/editor/client/panels/extra_properties.lua @@ -746,7 +746,7 @@ do -- event is_touching mins = mins, filter = ent } ) - + if self.udata then render.DrawWireframeBox( startpos, Angle( 0, 0, 0 ), mins, maxs, tr.Hit and Color(255,0,0) or Color(255,255,255), true ) end