TPG.State.GetSpawn(teamId)📋 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
| Name | Type | Description |
|---|---|---|
teamId | number | TEAM_GREEN or TEAM_RED. |
Returns
| Type | Description |
|---|---|
Vector | The spawn, or nil if none has been published this round. |
Examples
No examples available.
Used In
No usages found in the codebase.