From 96e3ce6ea48c01713a1a4d94f549f42c3d859abe Mon Sep 17 00:00:00 2001 From: ephphatha Date: Wed, 11 Aug 2021 23:39:27 +1000 Subject: [PATCH] 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. --- Source/objects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/objects.cpp b/Source/objects.cpp index 34813d6f3..f2c3e5710 100644 --- a/Source/objects.cpp +++ b/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(std::min(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)