Proper CPPI check

This commit is contained in:
Matt 2020-03-19 12:32:34 -04:00 committed by GitHub
parent d3945eedd4
commit b7da9f8c2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,9 +4,8 @@ util.AddNetworkString("Server_Has_PhysBuildMode")
AddCSLuaFile("autorun/client/cl_physgun_buildmode.lua")
local pb_ = "physgun_buildmode_"
local buildmode_ents = {}
local CPPIEnabled = FindMetaTable("Entity").CPPIGetOwner and true or false
if not CPPIEnabled then
if not CPPI then
print("[Physgun Build Mode] WARNING: No CPPI-Compatible prop protection found!")
end
@ -195,7 +194,7 @@ end)
local Phys_Grab = function() end
local function isPropMine(ply, ent)
if not CPPIEnabled then return true end
if not CPPI then return true end
return ent:CPPIGetOwner() == ply
end
@ -299,4 +298,4 @@ hook.Add("PhysgunPickup", "Physgun Build Mode:Pickup", function(ply, ent)
end
end)
print("[Physgun Build Mode] Finished loading")
print("[Physgun Build Mode] Finished loading")