mirror of
https://github.com/wiremod/advdupe2.git
synced 2025-03-04 03:03:05 -05:00
Fix AreaCopy when used with the CopyOutside param (#466)
* Fix AreaCopy when used with the CopyOutside param * Adjust param order * Fix call parameters
This commit is contained in:
parent
19eb2221a1
commit
94c6f4a4dd
@ -446,10 +446,9 @@ AdvDupe2.duplicator.Copy = Copy
|
||||
--[[
|
||||
Name: AreaCopy
|
||||
Desc: Copy based on a box
|
||||
Params: <entity> Entity
|
||||
Returns: <table> Entities, <table> 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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user