check PLAYER.CPPIGetOwner instead of CPPI global (#414)

Fixes partial implementations of CPPI and is more consistent with the rest of the code base
This commit is contained in:
aStonedPenguin 2023-03-01 10:37:09 -08:00 committed by GitHub
parent c78decb8be
commit df12047d51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -137,7 +137,7 @@ if(SERVER)then
--Find all the entities in a box, given the adjacent corners and the player
local function FindInBox(min, max, ply)
local PPCheck = (tobool(ply:GetInfo("advdupe2_copy_only_mine")) and CPPI~=nil) and PlayerCanDupeCPPI or PlayerCanDupeTool
local PPCheck = (tobool(ply:GetInfo("advdupe2_copy_only_mine")) and ply.CPPIGetOwner~=nil) and PlayerCanDupeCPPI or PlayerCanDupeTool
local Entities = ents.GetAll() --Don't use FindInBox. It has a 512 entity limit.
local EntTable = {}
local pos, ent