diff options
author | Stijn Buys <ingar@osirion.org> | 2013-10-17 20:06:56 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2013-10-17 20:06:56 +0000 |
commit | 186c38fed80afb3dc1ef2f54b144846505297506 (patch) | |
tree | 528874bd5b16d0f54526e50601efb874ead03cf4 /src | |
parent | b04e9dbada7f82434774b8af02db5c1f975ea2d6 (diff) |
Recalculate inventory after dropping a mine, do not allow mine drops on impulse speed.
Diffstat (limited to 'src')
-rw-r--r-- | src/game/base/game.cc | 7 |
1 files changed, 7 insertions, 0 deletions
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(); } } |