From e40f70a3af1142e6c0c89c6ea2ee47b996495661 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Mon, 20 Sep 2010 16:30:45 +0000 Subject: corrected trading inconsistencies, improved trade window, initial slider widget --- src/game/base/cargo.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/game/base') 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(); } -- cgit v1.2.3