Back to TPG

TPG.State.GetSpawn

S🏷️ State

Part of TPG namespace

TPG.State.GetSpawn(teamId)
View on GitHub|gamemode/core/sv_gamestate.lua:80-84
📋 Has LDoc👁️ 0 viewsUpdated 1 month ago

Description

The round's spawn for a team, or nil if there isn't a real one yet. Always read spawns through this rather than indexing TPG.State.spawns, which is empty until tpg.rounds.Setup publishes a round's spawns. "Real" excludes the map origin on purpose. Nothing legitimately spawns at 0,0,0 -- it is what you get from an unset Vector and from TPG.Maps.GetSpawn's own fallback -- and on most maps it is inside the world or under it, which is an out-of-world death that god mode does not stop. TPG.State.spawns used to default to that Vector, which is perfectly truthy, so every "do we have a spawn yet" check said yes and handed out the map origin. See player/sv_spawning.lua for what that cost.

Parameters

NameTypeDescription
teamIdnumberTEAM_GREEN or TEAM_RED.

Returns

TypeDescription
VectorThe spawn, or nil if none has been published this round.

Examples

No examples available.

Used In

No usages found in the codebase.