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>2013-10-17 20:06:56 +0000
committerStijn Buys <ingar@osirion.org>2013-10-17 20:06:56 +0000
commit186c38fed80afb3dc1ef2f54b144846505297506 (patch)
tree528874bd5b16d0f54526e50601efb874ead03cf4 /src/game/base/game.cc
parentb04e9dbada7f82434774b8af02db5c1f975ea2d6 (diff)
Recalculate inventory after dropping a mine, do not allow mine drops on impulse speed.
Diffstat (limited to 'src/game/base/game.cc')
-rw-r--r--src/game/base/game.cc7
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();
}
}