Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-09-20 16:30:45 +0000
committerStijn Buys <ingar@osirion.org>2010-09-20 16:30:45 +0000
commite40f70a3af1142e6c0c89c6ea2ee47b996495661 (patch)
treeba70a909b5066ad0e07e2f4eb8bc98684e4598e6 /src/game/base
parente8f7c4a06fce9e41fb23ffc42a566501a78210cb (diff)
corrected trading inconsistencies, improved trade window, initial slider widget
Diffstat (limited to 'src/game/base')
-rw-r--r--src/game/base/cargo.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/game/base/cargo.cc b/src/game/base/cargo.cc
index 382b03c..b54af55 100644
--- a/src/game/base/cargo.cc
+++ b/src/game/base/cargo.cc
@@ -257,11 +257,17 @@ void Cargo::buy(core::EntityControlable *buyer, core::Entity *seller, const int
}
// if amount is set to -1. the base has a limitless supply
+
if (seller_item->amount() == 0) {
buyer->owner()->send("^WCargo not available!");
return;
- } else if ((seller_item->amount() > 0) && (negotiated_amount > seller_item->amount())) {
- negotiated_amount = seller_item->amount();
+
+ } else if (seller_item->amount() > 0) {
+
+ if (negotiated_amount > seller_item->amount()) {
+ negotiated_amount = seller_item->amount();
+ }
+
seller_item->dec_amount(negotiated_amount);
seller->inventory()->set_dirty();
}