Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-10-15 22:39:04 +0000
committerStijn Buys <ingar@osirion.org>2010-10-15 22:39:04 +0000
commit208c13a72d72ab2aea08e79d8862e41c63fd1037 (patch)
tree19cff0b21d074488becdd1484a3a343ad8d9cee7 /src
parent2e7da03760895cb8438d53f8ab74bd2b5193ffe2 (diff)
destroy cargo when ejecting while docked
Diffstat (limited to 'src')
-rw-r--r--src/game/base/cargo.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/game/base/cargo.cc b/src/game/base/cargo.cc
index 3571b22..1a933e8 100644
--- a/src/game/base/cargo.cc
+++ b/src/game/base/cargo.cc
@@ -306,6 +306,13 @@ void Cargo::eject(core::EntityControlable *ejector, const int amount)
return;
}
+ if ((ejector->state() == core::Entity::Jump) || (ejector->state() == core::Entity::JumpInitiate)) {
+ if (ejector->owner()) {
+ ejector->owner()->send("^WCan not eject while hyperspace jump drive is active");
+ }
+ return;
+ }
+
// find the cargo in the inventory
core::Item *item = ejector->inventory()->find(this);
if (!item || !item->amount()) {
@@ -332,7 +339,7 @@ void Cargo::eject(core::EntityControlable *ejector, const int amount)
item->dec_amount(negotiated_amount);
ejector->inventory()->set_dirty();
- if (!ejector->state() == core::Entity::Docked) {
+ if (ejector->state() == core::Entity::Docked) {
std::stringstream msgstr;
if (ejector->owner()) {
msgstr << "^BDestroyed " << negotiated_amount << " " << aux::plural("unit", negotiated_amount) << " of " << name();