Back to TPG

TPG.Spawning.EnsureInWorld

S🏷️ Spawning

Part of TPG namespace

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

Description

Last line of defence, run on every spawn: if wherever the player ended up isn't inside the world, move them somewhere that is via FallbackPos. Cheap (one trace-free bounds check) and it can't misfire, since a legitimate spawn is always in the world and never exactly at the origin. If even the fallback finds nothing, this leaves the player where the engine put them and logs a one-time warning that the map has no usable spawn at all, since that means the map is unplayable as configured.

Parameters

NameTypeDescription
plyPlayer

Returns

No return values documented.

Examples

No examples available.

Used In

No usages found in the codebase.