diff --git a/lua/advdupe2/sv_clipboard.lua b/lua/advdupe2/sv_clipboard.lua index c8bf0d3..c95b264 100644 --- a/lua/advdupe2/sv_clipboard.lua +++ b/lua/advdupe2/sv_clipboard.lua @@ -446,10 +446,9 @@ AdvDupe2.duplicator.Copy = Copy --[[ Name: AreaCopy Desc: Copy based on a box - Params: Entity Returns: Entities,
Constraints ]] -function AdvDupe2.duplicator.AreaCopy(Entities, Offset, CopyOutside) +function AdvDupe2.duplicator.AreaCopy(ply, Entities, Offset, CopyOutside) local Constraints, EntTable, ConstraintTable = {}, {}, {} local index, add, AddEnts, AddConstrs, ConstTable, EntTab @@ -492,7 +491,7 @@ function AdvDupe2.duplicator.AreaCopy(Entities, Offset, CopyOutside) else -- Copy entities and constraints outside of the box that are constrained to entities inside the box ConstraintTable[_] = ConstTable for k, v in pairs(EntTab) do - Copy(v, EntTable, ConstraintTable, Offset) + Copy(ply, v, EntTable, ConstraintTable, Offset) end end end diff --git a/lua/weapons/gmod_tool/stools/advdupe2.lua b/lua/weapons/gmod_tool/stools/advdupe2.lua index f470674..e86143d 100644 --- a/lua/weapons/gmod_tool/stools/advdupe2.lua +++ b/lua/weapons/gmod_tool/stools/advdupe2.lua @@ -289,7 +289,7 @@ if(SERVER) then HeadEnt.Index = Ent:EntIndex() HeadEnt.Pos = Ent:GetPos() - Entities, Constraints = AdvDupe2.duplicator.AreaCopy(Ents, HeadEnt.Pos, tobool(ply:GetInfo("advdupe2_copy_outside"))) + Entities, Constraints = AdvDupe2.duplicator.AreaCopy(ply, Ents, HeadEnt.Pos, tobool(ply:GetInfo("advdupe2_copy_outside"))) self:SetStage(0) AdvDupe2.RemoveSelectBox(ply) @@ -348,7 +348,7 @@ if(SERVER) then HeadEnt.Index = Ent:EntIndex() HeadEnt.Pos = Ent:GetPos() - Entities, Constraints = AdvDupe2.duplicator.AreaCopy(Entities, HeadEnt.Pos, tobool(ply:GetInfo("advdupe2_copy_outside"))) + Entities, Constraints = AdvDupe2.duplicator.AreaCopy(ply, Entities, HeadEnt.Pos, tobool(ply:GetInfo("advdupe2_copy_outside"))) end end @@ -782,7 +782,7 @@ if(SERVER) then }) Tab.HeadEnt.Z = WorldTrace.Hit and math.abs(Tab.HeadEnt.Pos.Z - WorldTrace.HitPos.Z) or 0 - Tab.Entities, Tab.Constraints = AdvDupe2.duplicator.AreaCopy(Entities, Tab.HeadEnt.Pos, dupe.AutoSaveOutSide) + Tab.Entities, Tab.Constraints = AdvDupe2.duplicator.AreaCopy(ply, Entities, Tab.HeadEnt.Pos, dupe.AutoSaveOutSide) end Tab.Constraints = GetSortedConstraints(ply, Tab.Constraints) Tab.Description = dupe.AutoSaveDesc @@ -830,7 +830,7 @@ if(SERVER) then }) Tab.HeadEnt.Z = WorldTrace.Hit and math.abs(Tab.HeadEnt.Pos.Z - WorldTrace.HitPos.Z) or 0 - Tab.Entities, Tab.Constraints = AdvDupe2.duplicator.AreaCopy(Entities, Tab.HeadEnt.Pos, true) + Tab.Entities, Tab.Constraints = AdvDupe2.duplicator.AreaCopy(ply, Entities, Tab.HeadEnt.Pos, true) Tab.Constraints = GetSortedConstraints(ply, Tab.Constraints) Tab.Map = true