mirror of
https://github.com/wiremod/advdupe2.git
synced 2025-03-04 03:03:05 -05:00
Merge pull request #128 from thegrb93/gmodanchorfix
Fixes gmod anchor weirdness
This commit is contained in:
commit
5fc5bc1148
@ -982,6 +982,7 @@ function AdvDupe2.duplicator.Paste( Player, EntityList, ConstraintList, Position
|
||||
if(Ent.OnDuplicated)then Ent:OnDuplicated(v) end
|
||||
ApplyEntityModifiers( Player, Ent )
|
||||
ApplyBoneModifiers( Player, Ent )
|
||||
Ent.SolidMod = not Ent:IsSolid()
|
||||
Ent:SetNotSolid(true)
|
||||
elseif(Ent==false)then
|
||||
Ent = nil
|
||||
@ -1021,7 +1022,7 @@ function AdvDupe2.duplicator.Paste( Player, EntityList, ConstraintList, Position
|
||||
if(EntityList[_].BuildDupeInfo.DupeParentID and Parenting)then
|
||||
v:SetParent(CreatedEntities[EntityList[_].BuildDupeInfo.DupeParentID])
|
||||
end
|
||||
v:SetNotSolid(false)
|
||||
v:SetNotSolid( v.SolidMod )
|
||||
undo.AddEntity( v )
|
||||
end
|
||||
undo.SetPlayer( Player )
|
||||
@ -1044,7 +1045,7 @@ function AdvDupe2.duplicator.Paste( Player, EntityList, ConstraintList, Position
|
||||
v:SetParent(CreatedEntities[EntityList[_].BuildDupeInfo.DupeParentID])
|
||||
end
|
||||
|
||||
v:SetNotSolid(false)
|
||||
v:SetNotSolid( v.SolidMod )
|
||||
end
|
||||
end
|
||||
DisablePropCreateEffect = nil
|
||||
@ -1131,6 +1132,7 @@ local function AdvDupe2_Spawn()
|
||||
Ent.BoneMods = table.Copy( v.BoneMods )
|
||||
Ent.EntityMods = table.Copy( v.EntityMods )
|
||||
Ent.PhysicsObjects = table.Copy( v.PhysicsObjects )
|
||||
Ent.SolidMod = not Ent:IsSolid()
|
||||
|
||||
local Phys = Ent:GetPhysicsObject()
|
||||
if(IsValid(Phys))then Phys:EnableMotion(false) end
|
||||
@ -1280,7 +1282,7 @@ local function AdvDupe2_Spawn()
|
||||
end
|
||||
|
||||
if(not edit or not Queue.DisableParents)then
|
||||
v:SetNotSolid(false)
|
||||
v:SetNotSolid(v.SolidMod)
|
||||
end
|
||||
|
||||
undo.AddEntity( v )
|
||||
|
@ -26,13 +26,17 @@ if(SERVER)then
|
||||
return array
|
||||
end
|
||||
|
||||
local areacopy_classblacklist = {
|
||||
gmod_anchor = true
|
||||
}
|
||||
|
||||
local function PlayerCanDupeCPPI(ply, ent)
|
||||
if ent.DoNotDuplicate or not IsValid(ent:GetPhysicsObject()) or not duplicator.IsAllowed(ent:GetClass()) then return false end
|
||||
if ent.DoNotDuplicate or areacopy_classblacklist[ent:GetClass()] or not IsValid(ent:GetPhysicsObject()) or not duplicator.IsAllowed(ent:GetClass()) then return false end
|
||||
return ent:CPPIGetOwner()==ply
|
||||
end
|
||||
|
||||
|
||||
local function PlayerCanDupeTool(ply, ent)
|
||||
if ent.DoNotDuplicate or not IsValid(ent:GetPhysicsObject()) or not duplicator.IsAllowed(ent:GetClass()) then return false end
|
||||
if ent.DoNotDuplicate or areacopy_classblacklist[ent:GetClass()] or not IsValid(ent:GetPhysicsObject()) or not duplicator.IsAllowed(ent:GetClass()) then return false end
|
||||
local trace = WireLib and WireLib.dummytrace(ent) or { Entity = ent }
|
||||
return hook.Run( "CanTool", ply, trace, "advdupe2" ) ~= false
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user