From 5aa06377294d4423431f820978d4608230450ec3 Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Sun, 2 Aug 2026 04:14:37 +0300 Subject: [PATCH 1/3] Fixed a bug that could cause vector thrusters to spawn without an owner --- lua/wire/stools/vthruster.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lua/wire/stools/vthruster.lua b/lua/wire/stools/vthruster.lua index ef333760fb..27d0b30421 100644 --- a/lua/wire/stools/vthruster.lua +++ b/lua/wire/stools/vthruster.lua @@ -53,6 +53,15 @@ function TOOL:LeftClick( trace ) local ent = WireToolObj.LeftClick_Make(self, trace, ply ) if isbool(ent) then return ent end if IsValid(ent) then + undo.Create("WireVThruster") + undo.AddEntity( wire_thruster ) + undo.AddEntity( const ) + undo.SetPlayer( ply ) + undo.Finish() + + ply:AddCleanup( "wire_vthrusters", wire_thruster ) + ply:AddCleanup( "wire_vthrusters", const ) + ent:GetPhysicsObject():EnableMotion( false ) self:ReleaseGhostEntity() @@ -71,15 +80,6 @@ function TOOL:LeftClick( trace ) local Phys = wire_thruster:GetPhysicsObject() Phys:EnableMotion( true ) - undo.Create("WireVThruster") - undo.AddEntity( wire_thruster ) - undo.AddEntity( const ) - undo.SetPlayer( ply ) - undo.Finish() - - ply:AddCleanup( "wire_vthrusters", wire_thruster ) - ply:AddCleanup( "wire_vthrusters", const ) - self:ClearObjects() end From d8b57f0f8666ce3647d3e1478a1ea5f6103118a7 Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Sun, 2 Aug 2026 04:20:56 +0300 Subject: [PATCH 2/3] Fix undo --- lua/wire/stools/vthruster.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lua/wire/stools/vthruster.lua b/lua/wire/stools/vthruster.lua index 27d0b30421..fd957a823b 100644 --- a/lua/wire/stools/vthruster.lua +++ b/lua/wire/stools/vthruster.lua @@ -54,13 +54,11 @@ function TOOL:LeftClick( trace ) if isbool(ent) then return ent end if IsValid(ent) then undo.Create("WireVThruster") - undo.AddEntity( wire_thruster ) - undo.AddEntity( const ) + undo.AddEntity( ent ) undo.SetPlayer( ply ) undo.Finish() ply:AddCleanup( "wire_vthrusters", wire_thruster ) - ply:AddCleanup( "wire_vthrusters", const ) ent:GetPhysicsObject():EnableMotion( false ) self:ReleaseGhostEntity() @@ -76,6 +74,7 @@ function TOOL:LeftClick( trace ) local anchorbone = self:GetBone(1) local const = WireLib.Weld(wire_thruster, anchor, anchorbone, true, false) + if const then ply:AddCleanup( "wire_vthrusters", const ) end local Phys = wire_thruster:GetPhysicsObject() Phys:EnableMotion( true ) From dac2461a172df674b9acb1228d8ca6561acb23b0 Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Sun, 2 Aug 2026 04:23:09 +0300 Subject: [PATCH 3/3] Fix typo --- lua/wire/stools/vthruster.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wire/stools/vthruster.lua b/lua/wire/stools/vthruster.lua index fd957a823b..dc3c089c8e 100644 --- a/lua/wire/stools/vthruster.lua +++ b/lua/wire/stools/vthruster.lua @@ -58,7 +58,7 @@ function TOOL:LeftClick( trace ) undo.SetPlayer( ply ) undo.Finish() - ply:AddCleanup( "wire_vthrusters", wire_thruster ) + ply:AddCleanup( "wire_vthrusters", ent ) ent:GetPhysicsObject():EnableMotion( false ) self:ReleaseGhostEntity()