diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2009-02-09 05:07:27 -0500 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2009-02-09 05:07:27 -0500 |
| commit | 4c62b6c1f595d9de6b3faa8dca112900136c9b26 (patch) | |
| tree | 3d91f62edd58ffdc7e082bc3ea2af30c69a9a221 /sigencore/Player.cpp | |
| parent | e3228b55f6b456d6aa627b7ecc8548a390cb6e4c (diff) | |
| download | sigen-4c62b6c1f595d9de6b3faa8dca112900136c9b26.tar.gz sigen-4c62b6c1f595d9de6b3faa8dca112900136c9b26.tar.xz sigen-4c62b6c1f595d9de6b3faa8dca112900136c9b26.zip | |
Fixed calculation of actual money value
Diffstat (limited to 'sigencore/Player.cpp')
| -rw-r--r-- | sigencore/Player.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sigencore/Player.cpp b/sigencore/Player.cpp index 1f9e6057..25a819b5 100644 --- a/sigencore/Player.cpp +++ b/sigencore/Player.cpp @@ -144,7 +144,7 @@ bool Sigencore::Player::giveMoney(const int amount, const bool allOrNothing) valueOfType("money-minimum", &playerMin); valueOfType("money-maximum", &playerMax); const int newUnbounded = m_money + amount; - const int newAmount = qMin(qMax(0, playerMin), qMax(playerMax, newAmount)); + const int newAmount = qBound(qMax(0, playerMin), newUnbounded, qMin(playerMax, INT_MAX)); if (allOrNothing || (newUnbounded == newAmount)) { m_money = newAmount; |
