aboutsummaryrefslogtreecommitdiffstats
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-07-02 10:11:45 -0400
committerClyne Sullivan <tullivan99@gmail.com>2016-07-02 10:11:45 -0400
commitd96c869152527ae0c570de1d1c8552ec64d7fddb (patch)
tree89ef30120517c769be5c6fbf3920f6952b723950 /src/inventory.cpp
parent6f13e748c526576198d197ad194f4c1d8fdadec0 (diff)
fixed quest menu, only entity vector in worlds
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 7e8c94e..48adb86 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -342,12 +342,8 @@ void Inventory::draw(void) {
return sum / v.size();
};
- ui::fontTransInv = 255 * (averagef(dfp) / range);
- if (ui::fontTransInv > 255)
- ui::fontTransInv = 255;
- else if (ui::fontTransInv < 0)
- ui::fontTransInv = 0;
-
+ ui::fontTransInv = std::clamp(255 * (averagef(dfp) / range), 0ul, 255ul);
+
if (invOpening) {
for (auto &d : dfp) {
if (!a || dfp[a - 1] > 50)