Back to TPG

tpg.ent.flag.server:ReturnHome

S🏷️ Flag

Part of TPG namespace

ENT:ReturnHome(reason)
View on GitHub|entities/entities/tpg_flag/init.lua:74-87
📋 Has LDoc👁️ 0 viewsUpdated 1 month ago

Description

Reset the flag to STATE_HOME with no possessor, broadcast why, and teleport it to a freshly-rolled home spot. Re-rolls the home spot on every reset (via TPG.CTF.RollFlagPoint) rather than returning to a fixed position, so the flag moves around the map over a round (KOTH point vs. the CP points) instead of living wherever it first rolled at spawn. RollFlagPoint returns a fixed custom point if an admin placed one, so overridden maps still stay put. Called after a capture (from TPG.CTF.OnCapture), after a carry timeout, and after a drop-return timeout -- reason is only used for the chat line, it does not change any behaviour. "carried too long", "timed out". Omit for a bare reset message.

Parameters

NameTypeDescription
reason?stringShown in the broadcast, e.g. `"captured"`,

Returns

No return values documented.

Examples

No examples available.

Used In

No usages found in the codebase.