SC2Mapster.com Wiki

MaxF

fixed MaxF(fixed a, fixed b);

Maximum value between a and b

Parameters

fixed a

First value to be compared with.

fixed b

Second value to be compared with.

Return value

fixed - The greatest value between a and b.

Examples

Example #1: Function definition
fixed MaxF(fixed a, fixed b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}
Example #2: Sample Usage
MaxF(5, 10); // 10
MaxF(-5, 3); // 3
Example #3: Real Usage
fixed AIRangeMothership (int player, unit aiUnit) {
    return MaxF(AIAbilityFixed(player, c_AB_Vortex, c_fieldRange0),
                AIAbilityFixed(player, c_AB_TemporalRift, c_fieldRange0)) + 1;
}

You must login to post a comment. Don't have an account? Register to get one!

Facts

Date created
Mar 10, 2010
Last updated
Mar 10, 2010

Authors