diff --git a/lua/arccw/shared/sh_physbullet2.lua b/lua/arccw/shared/sh_physbullet2.lua index a6a97929..5169e9d3 100644 --- a/lua/arccw/shared/sh_physbullet2.lua +++ b/lua/arccw/shared/sh_physbullet2.lua @@ -202,6 +202,8 @@ net.Receive("arccw_sendbullet", function(len, ply) if game.SinglePlayer() then ent = net.ReadEntity() + else + ent = weapon:GetOwner() end local bullet = { @@ -214,7 +216,7 @@ net.Receive("arccw_sendbullet", function(len, ply) Dead = false, Damaged = {}, Drag = drag, - Attacker = ent or weapon:GetOwner(), + Attacker = ent, Gravity = grav, Profile = profile, PhysBulletImpact = impact, diff --git a/lua/effects/arccw_muzzleeffect.lua b/lua/effects/arccw_muzzleeffect.lua index 0c8901eb..c1147396 100644 --- a/lua/effects/arccw_muzzleeffect.lua +++ b/lua/effects/arccw_muzzleeffect.lua @@ -3,6 +3,7 @@ function EFFECT:Init(data) local wpn = data:GetEntity() if !IsValid(wpn) then return end + if !wpn.ArcCW then return end local muzzle = wpn.MuzzleEffect local overridemuzzle = wpn:GetBuff_Override("Override_MuzzleEffect") diff --git a/lua/weapons/arccw_base/cl_customize2.lua b/lua/weapons/arccw_base/cl_customize2.lua index b3c5a810..61b1bcee 100644 --- a/lua/weapons/arccw_base/cl_customize2.lua +++ b/lua/weapons/arccw_base/cl_customize2.lua @@ -614,9 +614,11 @@ function SWEP:CreateCustomize2HUD() self2.AlreadySet = true end - local scroll = self2:GetScroll() + if IsValid(self.Inv_Scroll) then + local scroll = self2:GetScroll() - self.Inv_Scroll[self.Inv_SelectedSlot or 0] = scroll + self.Inv_Scroll[self.Inv_SelectedSlot or 0] = scroll + end end scroll_2.btnUp.Paint = function(span, w, h) @@ -1450,7 +1452,7 @@ function SWEP:CreateCustomize2HUD() local txt = (translate("ui.toggle")) local catttbl = ArcCW.AttachmentTable[att] - if catttbl and catttbl.ToggleStats[self.Attachments[slot].ToggleNum] + if catttbl and IsValid(self.Attachments) and catttbl.ToggleStats[self.Attachments[slot].ToggleNum] and catttbl.ToggleStats[self.Attachments[slot].ToggleNum].PrintName then txt = try_translate(catttbl.ToggleStats[self.Attachments[slot].ToggleNum].PrintName) end @@ -1492,7 +1494,11 @@ function SWEP:CreateCustomize2HUD() draw.RoundedBox(cornerrad, 0, 0, w, h, col) surface.SetDrawColor(col2.r, col2.g, col2.b) - surface.SetMaterial(self.Attachments[slot].ToggleLock and iconlock or iconunlock) + if IsValid(self.Attachments) then + surface.SetMaterial(self.Attachments[slot].ToggleLock and iconlock or iconunlock) + else + surface.SetMaterial(iconunlock) + end surface.DrawTexturedRect(4, 4, w - 8, h - 8) end diff --git a/lua/weapons/arccw_base/sh_attach.lua b/lua/weapons/arccw_base/sh_attach.lua index 81ee8266..d532a2e1 100644 --- a/lua/weapons/arccw_base/sh_attach.lua +++ b/lua/weapons/arccw_base/sh_attach.lua @@ -669,10 +669,15 @@ function SWEP:GetMuzzleDevice(wm) if self:GetInUBGL() then local _, slot = self:GetBuff_Override("UBGL") + local muzz2 = nil + if IsValid(self.Attachments) then + muzz2 = (self.Attachments[slot].WMuzzleDeviceElement or {}).Model + end + if wm then - muzz = (self.Attachments[slot].WMuzzleDeviceElement or {}).Model or muzz + muzz = muzz2 or muzz else - muzz = (self.Attachments[slot].VMuzzleDeviceElement or {}).Model or muzz + muzz = muzz2 or muzz end end