wiremod/wire

Changing E2 cores breaks CPPI checks

Closed this issue · 0 comments

Currently CPPI is only checked once on InitPostEntity

if FindMetaTable("Entity").CPPIGetOwner then
local _getOwner = E2Lib.getOwner
E2Lib.replace_function("getOwner", function(self, entity)
if not IsValid(entity) then return end
if entity == self.entity or entity == self.player then return self.player end
local owner = entity:CPPIGetOwner()
if IsValid(owner) then return owner end
return _getOwner(self, entity)
end)

However when cores are changed it isn't reapplied resulting in functions using CPPI breaking such as entity:setPos()