Browse Source

ensure std::min call uses correct types, cast result explicitly

No idea why template deduction was failing on 3ds builds only... It was using the context of the return type to deduce what the template arguments should be? Hopefully specifying the template explicitly works.
pull/2585/head
ephphatha 5 years ago committed by Anders Jenbo
parent
commit
96e3ce6ea4
  1. 2
      Source/objects.cpp

2
Source/objects.cpp

@ -3409,7 +3409,7 @@ bool OperateShrineGlowing(int pnum)
auto &myPlayer = Players[MyPlayerId];
// Add 0-5 points to Magic (0.1% of the players XP)
ModifyPlrMag(MyPlayerId, std::min(myPlayer._pExperience / 1000, 5U));
ModifyPlrMag(MyPlayerId, static_cast<int>(std::min<uint32_t>(myPlayer._pExperience / 1000, 5)));
// Take 5% of the players experience to offset the bonus, unless they're very low level in which case take all their experience.
if (myPlayer._pExperience > 5000)

Loading…
Cancel
Save