summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-04-20 13:50:37 +0200
committermadmaxoft <github@xoft.cz>2014-04-20 13:50:37 +0200
commit7b246d9a8dae22937171a753072d72b4732986d7 (patch)
tree2b709153c59d17313589e4808efb6e47e26de4bf
parentMerge pull request #890 from daniel0916/Enchanting (diff)
downloadcuberite-7b246d9a8dae22937171a753072d72b4732986d7.tar
cuberite-7b246d9a8dae22937171a753072d72b4732986d7.tar.gz
cuberite-7b246d9a8dae22937171a753072d72b4732986d7.tar.bz2
cuberite-7b246d9a8dae22937171a753072d72b4732986d7.tar.lz
cuberite-7b246d9a8dae22937171a753072d72b4732986d7.tar.xz
cuberite-7b246d9a8dae22937171a753072d72b4732986d7.tar.zst
cuberite-7b246d9a8dae22937171a753072d72b4732986d7.zip
Diffstat (limited to '')
-rw-r--r--src/UI/SlotArea.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp
index 5f74b4fa3..e062598c8 100644
--- a/src/UI/SlotArea.cpp
+++ b/src/UI/SlotArea.cpp
@@ -806,7 +806,7 @@ void cSlotAreaEnchanting::UpdateResult(cPlayer & a_Player)
int Bookshelves = std::min(GetBookshelvesCount(a_Player.GetWorld()), 15);
cFastRandom Random;
- int base = (Random.GenerateRandomInteger(1, 8) + floor(Bookshelves / 2) + Random.GenerateRandomInteger(0, Bookshelves));
+ int base = (Random.GenerateRandomInteger(1, 8) + (int)floor((float)Bookshelves / 2) + Random.GenerateRandomInteger(0, Bookshelves));
int topSlot = std::max(base / 3, 1);
int middleSlot = (base * 2) / 3 + 1;
int bottomSlot = std::max(base, Bookshelves * 2);