# Clamp (Real)

Grammar — Clamp value between min and max
FlagsFunction

Adjust the value to make sure it stays within the provided bounds.

# Arguments

  • fixed — Value
  • fixed — Min
  • fixed — Max

Returns — fixed

fixed libNtve_gf_ArithmeticRealClamp(
	fixed lp_value,
	fixed lp_min,
	fixed lp_max,
);

Category: Math / Arithmetic

# Examples

mods/heroesmapmods/battlegroundmapmods/volskayamechanics.stormmodbase.stormdata/LibVLSK.galaxy:311

    }
    else {
        libVLSK_gv_capturePoints[lp_capturePointIndex].lv_contestTimes[lp_contestingTeam] = libNtve_gf_ArithmeticRealClamp(lv_newProgress, 0.0, libVLSK_gv_capturePointContestTimeGoal_C);
    }
    if ((libVLSK_gv_capturePoints[lp_capturePointIndex].lv_contestTimes[lp_contestingTeam] == libVLSK_gv_capturePointContestTimeGoal_C) && (libVLSK_gv_capturePoints[lp_capturePointIndex].lv_owningTeam != lp_contestingTeam)) {

mods/heroesmapmods/battlegroundmapmods/volskayamechanics.stormmodbase.stormdata/LibVLSK.galaxy:390


    // Implementation
    libVLSK_gv_capturePoints[lp_capturePointIndex].lv_contestTimes[lp_team] = libNtve_gf_ArithmeticRealClamp(lv_newProgressValue, 0.0, libVLSK_gv_capturePointContestTimeGoal_C);
    if ((libVLSK_gv_capturePoints[lp_capturePointIndex].lv_contestTimes[lp_team] == 0.0)) {
        if ((libVLSK_gv_capturePoints[lp_capturePointIndex].lv_wasDecaying[lp_team] == true)) {

mods/heroesmapmods/battlegroundmapmods/volskayamechanics.stormmodbase.stormdata/LibVLSK.galaxy:438

    lv_team = 1;
    for ( ; ( (auto8A7EDE45_ai >= 0 && lv_team <= auto8A7EDE45_ae) || (auto8A7EDE45_ai < 0 && lv_team >= auto8A7EDE45_ae) ) ; lv_team += auto8A7EDE45_ai ) {
        libVLSK_gv_capturePoints[lp_capturePointIndex].lv_victoryTimes[lv_team] = libNtve_gf_ArithmeticRealClamp(libVLSK_gv_capturePoints[lp_capturePointIndex].lv_victoryTimes[lv_team], 0.0, (libVLSK_gv_capturePointVictoryTimeGoal_C * 0.999));
    }
}

mods/heromods/hanzo.stormmodbase.stormdata/LibHHAN.galaxy:230

        lv_currentSearchStartDistance = lv_currentEstimatedMissileDistance;
        lv_currentSearchEndDistance = (lv_currentSearchStartDistance - lv_searchLength);
        lv_currentSearchStartDistance = libNtve_gf_ArithmeticRealClamp(lv_currentSearchStartDistance, lv_searchStartDistance, lv_searchEndDistance);
        lv_currentSearchEndDistance = libNtve_gf_ArithmeticRealClamp(lv_currentSearchEndDistance, lv_searchStartDistance, lv_searchEndDistance);
        lv_currentSearchLength = (lv_currentSearchStartDistance - lv_currentSearchEndDistance);

mods/heromods/hanzo.stormmodbase.stormdata/LibHHAN.galaxy:231

        lv_currentSearchEndDistance = (lv_currentSearchStartDistance - lv_searchLength);
        lv_currentSearchStartDistance = libNtve_gf_ArithmeticRealClamp(lv_currentSearchStartDistance, lv_searchStartDistance, lv_searchEndDistance);
        lv_currentSearchEndDistance = libNtve_gf_ArithmeticRealClamp(lv_currentSearchEndDistance, lv_searchStartDistance, lv_searchEndDistance);
        lv_currentSearchLength = (lv_currentSearchStartDistance - lv_currentSearchEndDistance);
        CatalogFieldValueSetFixed(c_gameCatalogEffect, "HanzoDragonstrikeSearchArea", "AreaArray[" + IntToString(0) + "].RectangleHeight", lv_playerNumber, lv_currentSearchLength);