Back to TPG

TPG.Util.GetOwner

S🏷️ Util

Part of TPG namespace

TPG.Util.GetOwner(ent)
View on GitHub|gamemode/core/sh_utils.lua:141-148
📋 Has LDoc👁️ 0 viewsUpdated 1 month ago

Description

Who owns this entity, according to the prop-protection addon. Ownership comes from CPPI, which is an INTERFACE, not an addon: whichever prop protection is installed (NADMOD, FPP, SPP) provides it, and a server running none of them has no CPPIGetOwner at all. Calling it unguarded is an error on exactly the servers least able to debug it, so every read of an owner in this gamemode goes through here. A missing provider is reported as "nobody owns anything" rather than as a failure, because that is what it means: with nothing tracking ownership there is no answer to give. Callers already handle the no-owner case, and the systems that care loudly about a missing provider say so once at startup (see systems/sv_ace_permission.lua) instead of at every call. genuinely unowned. World-owned entities come back nil too.

Parameters

NameTypeDescription
entEntity

Returns

TypeDescription
PlayerThe owner, or nil for an invalid entity, no provider, or

Examples

No examples available.

Used In

No usages found in the codebase.