Skip to content

Commit

Permalink
Improved CPPI implementation
Browse files Browse the repository at this point in the history
- CPPIGetOwner will now return the world entity and an UID of 0 in case the entity has no valid owner.
- Implemented required CPPI_NOTIMPLEMENTED and CPPI_DEFER values.
  • Loading branch information
TwistedTail committed Nov 17, 2024
1 parent 3d8265c commit cefd42f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/acf/compatibility/cppi_compatibility.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ timer.Simple(1, function()
local Entities = {}
local Backup = {}

CPPI_NOTIMPLEMENTED = -1
CPPI_DEFER = -2

function CPPI:GetName() return "CPPI for ACF3" end
function CPPI:GetVersion() return "ACF3" end
function CPPI:GetInterfaceVersion() return 1.3 end
Expand All @@ -24,7 +27,7 @@ timer.Simple(1, function()
function ENTITY:CPPIGetOwner()
local Owner = SERVER and self.CPPIOwner or self:GetNWEntity("CPPIOwner")

if not IsValid(Owner) then return end
if not IsValid(Owner) then return game.GetWorld(), 0 end

return Owner, Owner:UniqueID()
end
Expand Down

0 comments on commit cefd42f

Please sign in to comment.