diff options
-rw-r--r-- | src/game/base/cargo.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/game/base/cargo.cc b/src/game/base/cargo.cc index b54af55..3014a1e 100644 --- a/src/game/base/cargo.cc +++ b/src/game/base/cargo.cc @@ -5,6 +5,7 @@ */ #include <assert.h> +#include <cmath> #include "base/game.h" #include "base/cargo.h" @@ -241,7 +242,7 @@ void Cargo::buy(core::EntityControlable *buyer, core::Entity *seller, const int // maximum cargo size if (negotiated_amount * volume() > buyer->inventory()->capacity_available()) { - negotiated_amount = buyer->inventory()->capacity_available() / volume(); + negotiated_amount = (int)floorf(buyer->inventory()->capacity_available() / volume()); } if (negotiated_amount < 1) { |