diff --git a/lua/entities/gmod_wire_turret.lua b/lua/entities/gmod_wire_turret.lua index f2805a55bc..62dc0d9d72 100644 --- a/lua/entities/gmod_wire_turret.lua +++ b/lua/entities/gmod_wire_turret.lua @@ -27,7 +27,10 @@ function ENT:Initialize() self.Firing = false self.spreadvector = Vector() self.effectdata = EffectData() - self.attachmentPos = phys:WorldToLocal(self:GetAttachment(1).Pos) + + -- Not all entities have an 1 attachment + local attachment = self:GetAttachment(1) + self.attachmentPos = attachment and self:WorldToLocal(attachment.Pos) or vector_origin self.Inputs = WireLib.CreateSpecialInputs(self, { "Fire", "Force", "Damage", "NumBullets", "Spread", "Delay", "Sound", "Tracer" }, diff --git a/lua/wire/stools/turret.lua b/lua/wire/stools/turret.lua index ad936c0547..bfc8918880 100644 --- a/lua/wire/stools/turret.lua +++ b/lua/wire/stools/turret.lua @@ -45,20 +45,6 @@ if SERVER then end end -local ValidTurretModels = { - ["models/weapons/w_smg1.mdl"] = true, - ["models/weapons/w_smg_mp5.mdl"] = true, - ["models/weapons/w_smg_mac10.mdl"] = true, - ["models/weapons/w_rif_m4a1.mdl"] = true, - ["models/weapons/w_357.mdl"] = true, - ["models/weapons/w_shot_m3super90.mdl"] = true -} - -function TOOL:GetModel() - local model = WireToolObj.GetModel(self) - return ValidTurretModels[model] and model or "models/weapons/w_smg1.mdl" -end - function TOOL.BuildCPanel( CPanel ) WireToolHelpers.MakePresetControl(CPanel, "wire_turret")