From 4e1458477d212bd9103b73eb3e63a503f4e1d8a6 Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Sat, 28 Mar 2026 22:16:01 +0300 Subject: [PATCH 1/3] Remove turret models whitelist There is no reason to limit it to just that --- lua/wire/stools/turret.lua | 14 -------------- 1 file changed, 14 deletions(-) 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") From 249ca03e713d14ece1fd3eb9a3b1395c759595d6 Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Sat, 28 Mar 2026 22:18:52 +0300 Subject: [PATCH 2/3] Check for attachment --- lua/entities/gmod_wire_turret.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/entities/gmod_wire_turret.lua b/lua/entities/gmod_wire_turret.lua index f2805a55bc..f53e8f46e0 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 phys:WorldToLocal(attachment.Pos) or vector_origin self.Inputs = WireLib.CreateSpecialInputs(self, { "Fire", "Force", "Damage", "NumBullets", "Spread", "Delay", "Sound", "Tracer" }, From 179860fa9fcfe6acfff8527bb664486dbc43558a Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Sat, 28 Mar 2026 22:26:35 +0300 Subject: [PATCH 3/3] Don't rely on physobj --- lua/entities/gmod_wire_turret.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/entities/gmod_wire_turret.lua b/lua/entities/gmod_wire_turret.lua index f53e8f46e0..62dc0d9d72 100644 --- a/lua/entities/gmod_wire_turret.lua +++ b/lua/entities/gmod_wire_turret.lua @@ -30,7 +30,7 @@ function ENT:Initialize() -- Not all entities have an 1 attachment local attachment = self:GetAttachment(1) - self.attachmentPos = attachment and phys:WorldToLocal(attachment.Pos) or vector_origin + self.attachmentPos = attachment and self:WorldToLocal(attachment.Pos) or vector_origin self.Inputs = WireLib.CreateSpecialInputs(self, { "Fire", "Force", "Damage", "NumBullets", "Spread", "Delay", "Sound", "Tracer" },