mirror of
https://github.com/wiremod/advdupe2.git
synced 2025-03-04 03:03:05 -05:00
Fix physobj OOB access (#483)
* Fix physobj OOB access * Fix broken contributing link
This commit is contained in:
parent
ac5f1f202a
commit
41d4fa6f2b
@ -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.
|
||||
|
||||
---
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user