Back to TPG

TPG.Rounds.Setup

S🏷️ Rounds

Part of TPG namespace

TPG.Rounds.Setup(skipCleanup)
View on GitHub|gamemode/core/sv_rounds.lua:152-269
📋 Has LDoc👁️ 0 viewsUpdated 1 month ago

Description

Start a round: pick the mode, reset the map and state, spawn objectives, and open the prep window. In order, this ends the wait-for-players window, clears overtime, loads the map config, maybe scrambles the teams, rolls the game type and the economy, swaps the two sides' spawns, applies the map's prop and point limits, cleans the map, resets round state, spawns objectives, safezones and (in CTF) the flags, respawns everyone on a team, syncs to clients, and calls TPG.Prep.Begin. Two things only happen from the second round on, both gated on TPG.State.round.startTime > 0: the spawn swap, so the first round of a map uses the config as written; and the auto-scramble, which also needs at least four players on teams. Respawning kills only players who are on a playing team. Spectators are skipped on purpose: they have no spawn to be moved to, so killing them was a death for nothing, and at map start (nobody has picked a side yet) that is a death for everyone on the server as their first impression of the gamemode. Safe to call at any time -- an admin restart or a points reload comes through here too, which is why it force-clears the wait window rather than assuming it is already closed. TPG.Rounds.CleanupMap). Used when the caller has already cleaned, or is reloading config mid-round and wants players' builds left standing.

Parameters

NameTypeDescription
skipCleanup?booleanSkip the map cleanup entirely (see(default: false)

Returns

No return values documented.

Examples

No examples available.

Used In

No usages found in the codebase.