Back to TPG

TPG.Spawning.FallbackPos

S🏷️ Spawning

Part of TPG namespace

TPG.Spawning.FallbackPos(ply)
View on GitHub|gamemode/player/sv_spawning.lua:93-114
📋 Has LDoc👁️ 0 viewsUpdated 1 month ago

Description

A position that is definitely not the void, for someone with nowhere better to go. Preference order: ply's own team's round spawn (falling back to trying both teams if ply is invalid or unteamed), then the map config's spawns (which TPG.Maps.Get loads on demand, so this works before the first round), then whatever spawn entities the map ships (see SPAWN_CLASSES above). Every candidate is re-checked against the same in-world/non-zero test, so a bad round spawn can't leak through even if one were ever published. spawns and none of SPAWN_CLASSES at all, meaning the map is unplayable.

Parameters

NameTypeDescription
plyPlayerUsed only to prefer their own team; may be invalid.

Returns

TypeDescription
Vectornil only if the map has no round spawns, no configured

Examples

No examples available.

Used In

No usages found in the codebase.