diff --git a/lua/entities/gmod_wire_hydraulic.lua b/lua/entities/gmod_wire_hydraulic.lua index b42847a943..cb30670908 100644 --- a/lua/entities/gmod_wire_hydraulic.lua +++ b/lua/entities/gmod_wire_hydraulic.lua @@ -141,7 +141,9 @@ function MakeWireHydraulicController( pl, Pos, Ang, model, MyEntId, const, rope if not IsValid(controller) then return end if not const then - WireHydraulicTracking[ MyEntId ] = controller + if MyEntId then + WireHydraulicTracking[ MyEntId ] = controller + end else controller.MyId = controller:EntIndex() const.MyCrtl = controller:EntIndex() diff --git a/lua/entities/gmod_wire_motor.lua b/lua/entities/gmod_wire_motor.lua index 7170cb4c28..698e07a0c4 100644 --- a/lua/entities/gmod_wire_motor.lua +++ b/lua/entities/gmod_wire_motor.lua @@ -55,7 +55,9 @@ function MakeWireMotorController( pl, Pos, Ang, MyEntId, model, const, axis ) if not IsValid(controller) then return end if not const then - WireMotorTracking[ MyEntId ] = controller + if MyEntId then + WireMotorTracking[ MyEntId ] = controller + end else controller.MyId = controller:EntIndex() const.MyCrtl = controller:EntIndex()