From 186c38fed80afb3dc1ef2f54b144846505297506 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 17 Oct 2013 20:06:56 +0000 Subject: Recalculate inventory after dropping a mine, do not allow mine drops on impulse speed. --- src/game/base/game.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/game/base/game.cc b/src/game/base/game.cc index 438154d..ad6a28c 100644 --- a/src/game/base/game.cc +++ b/src/game/base/game.cc @@ -1156,6 +1156,12 @@ void Game::func_drop(core::Player *player, const std::string &args) if (labelstr.compare("mine") == 0) { // drop a mine + // cannot drop items while jumping + if ((ship->state() == core::Entity::Impulse) || (ship->state() == core::Entity::ImpulseInitiate)) { + player->send("^WCan not drop mines on impulse speed"); + return; + } + // find a mine in inventory const Weapon *weapon = 0; core::Item *item = 0; @@ -1194,6 +1200,7 @@ void Game::func_drop(core::Player *player, const std::string &args) if (item->amount() == 0) { ship->inventory()->erase(item->id()); } + ship->inventory()->set_dirty(); } } -- cgit v1.2.3