Skip to content

Commit 84bd631

Browse files
authored
Fix issues with global vertices/position on EGP polys (#3357)
* Stop fakepos from creating parent indexes to unparented objects * Fix improper calls of EGP.GetGlobalVertices
1 parent f1e5c92 commit 84bd631

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

lua/entities/gmod_wire_egp/lib/egplib/parenting.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ EGP.ParentingFuncs.addUV = addUV
2323
local function makeArray( v, fakepos )
2424
local ret = {}
2525
if isstring(v.verticesindex) then
26-
if not fakepos then
27-
if (not v["_"..v.verticesindex]) then EGP:AddParentIndexes( v ) end
26+
if not fakepos and v["_"..v.verticesindex] then
2827
for k,v in ipairs( v["_"..v.verticesindex] ) do
2928
ret[#ret+1] = v.x
3029
ret[#ret+1] = v.y

lua/entities/gmod_wire_expression2/core/egpfunctions.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ end
853853
e2function array wirelink:egpGlobalVertices( number index )
854854
local hasobject, _, object = hasObject(this, index)
855855
if hasobject and object.verticesindex then
856-
local data = EGP:GetGlobalVertices(object)
856+
local data = EGP.GetGlobalVertices(this, object)
857857
if data.vertices then
858858
local ret = {}
859859
for i=1,#data.vertices do

lua/entities/gmod_wire_expression2/core/egpobjects.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ end
588588
e2function array egpobject:globalVertices()
589589
if not isValid(this) then return self:throw("Invalid EGP Object", {}) end
590590
if this.verticesindex then
591-
local data = EGP:GetGlobalVertices(this.EGP, this)
591+
local data = EGP.GetGlobalVertices(this.EGP, this)
592592
if data.vertices then
593593
local ret = {}
594594
for i = 1, #data.vertices do

0 commit comments

Comments
 (0)