diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f9b664c..c7cfe82 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Coding Guidelines -Please see https://github.com/wiremod/wire/wiki/Coding-style for information on how code formatting is standardized in the Wiremod project. +Please see https://github.com/wiremod/wire/wiki/Developer-Style-Guide for information on how code formatting is standardized in the Wiremod project. --- diff --git a/lua/advdupe2/sv_clipboard.lua b/lua/advdupe2/sv_clipboard.lua index 36c2391..f812c70 100644 --- a/lua/advdupe2/sv_clipboard.lua +++ b/lua/advdupe2/sv_clipboard.lua @@ -1415,8 +1415,10 @@ local function AdvDupe2_Spawn() edit = false end + local physCount = v:GetPhysicsObjectCount() - 1 + if (unfreeze) then - for i = 0, v:GetPhysicsObjectCount() do + for i = 0, physCount do phys = v:GetPhysicsObjectNum(i) if (IsValid(phys)) then phys:EnableMotion(true) -- Unfreeze the entitiy and all of its objects @@ -1424,7 +1426,7 @@ local function AdvDupe2_Spawn() end end elseif (preservefrozenstate) then - for i = 0, v:GetPhysicsObjectCount() do + for i = 0, physCount do phys = v:GetPhysicsObjectNum(i) if (IsValid(phys)) then if (Queue.EntityList[k].BuildDupeInfo.PhysicsObjects[i].Frozen) then @@ -1436,7 +1438,7 @@ local function AdvDupe2_Spawn() end end else - for i = 0, v:GetPhysicsObjectCount() do + for i = 0, physCount do phys = v:GetPhysicsObjectNum(i) if (IsValid(phys)) then if (phys:IsMoveable()) then