Back to TPG

TPG.Gear.FallbackAllowed

S🏷️ Gear

Part of TPG namespace

TPG.Gear.FallbackAllowed(category, id)
View on GitHub|gamemode/config/sh_gear.lua:256-270
📋 Has LDoc👁️ 0 viewsUpdated 1 month ago

Description

Whether an item is a legal FALLBACK for a slot -- what you get when the pick in that slot is refused. A fallback has to be free. If it were not, a refused Javelin could fall back to a Carl Gustaf that is itself mid-timer, and the slot would have to refuse again; the loadout code would then need a fallback for the fallback, with no obvious end to it. Free means one refusal always resolves. "none" is always legal, and in the Special slot it is not the same as "nothing" -- see FallbackLoadout in config/sh_weapons_config.lua. Shared so the menu greys out exactly what the server would reject, rather than offering a choice that silently does not take.

Parameters

NameTypeDescription
categorystring`"Primary"`, `"Secondary"` or `"Special"`.
idstringA weapon class, or `"none"`.

Returns

TypeDescription
boolean
stringWhy not, when false, in words a player can read.

Examples

No examples available.

Used In

No usages found in the codebase.