ReducePlayerTechMaxAllowed

Parameters
whichPlayerplayer
techIdinteger
limitinteger
comment
patch

1.00

Source
Blizzard.j (raise an issue to discuss on Github or submit a PR)
return type
nothing
Source code
function ReducePlayerTechMaxAllowed takes player whichPlayer, integer techId, integer limit returns nothing
    local integer oldMax = GetPlayerTechMaxAllowed(whichPlayer, techId)

    // A value of -1 is used to indicate no limit, so check for that as well.
    if (oldMax < 0 or oldMax > limit) then
        call SetPlayerTechMaxAllowed(whichPlayer, techId, limit)
    endif
endfunction