Back to TPG

TPG.ControlPoint.CalculateCaptureSpeed

S🏷️ Controlpoint

Part of TPG namespace

TPG.ControlPoint.CalculateCaptureSpeed(greenCount, redCount)
View on GitHub|gamemode/objectives/sh_controlpoint.lua:87-90
📋 Has LDoc👁️ 0 viewsUpdated 1 month ago

Description

How fast a point captures, from who is standing on it. The signed head-count difference, clamped to TPG.Config.capMaxPlayers in both directions. Only the difference counts, so an evenly contested point returns 0 and does not move at all no matter how many are on it; and the clamp means stacking more than capMaxPlayers extra bodies buys nothing.

Parameters

NameTypeDescription
greenCountnumberGreen players on the point.
redCountnumberRed players on the point.

Returns

TypeDescription
numberSigned speed; positive captures toward green.

Examples

No examples available.

Used In

No usages found in the codebase.