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-01-01 16:16:59 +0000
committerStijn Buys <ingar@osirion.org>2013-01-01 16:16:59 +0000
commitd3ed23de89a7c1ddbb92990eee966966ee8fbeee (patch)
treeb3c48b0b8d2ca3ef847a25746b7fc0fe7505cfef /src/game/base/game.cc
parent614ce1267772d67825a32fb7495a049cd6498fe5 (diff)
Turrets and cannons can only be mounted in an approriate slot.
Diffstat (limited to 'src/game/base/game.cc')
-rw-r--r--src/game/base/game.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/game/base/game.cc b/src/game/base/game.cc
index a44650b..efb89fe 100644
--- a/src/game/base/game.cc
+++ b/src/game/base/game.cc
@@ -1213,7 +1213,7 @@ void Game::func_mount(core::Player *player, const std::string &args)
}
const Weapon *weapon = static_cast<const Weapon *>(item->info());
- if (!item->unique() || (weapon->subtype() != Weapon::Cannon)) {
+ if (!item->unique() || ((weapon->subtype() != Weapon::Cannon) && (weapon->subtype() != Weapon::Turret)) ) {
if (ship->owner()) {
std::stringstream msgstr;
msgstr << "^W" << weapon->name() << " can not be mounted";
@@ -1244,8 +1244,8 @@ void Game::func_mount(core::Player *player, const std::string &args)
// mount
core::Slot *slot = 0;
- for(core::Slots::iterator it = ship->slots()->begin(); (!slot) && (it != ship->slots()->end()); ++it) {
- if (!(*it)->has_flag(core::Slot::Mounted)) {
+ for(core::Slots::iterator it = ship->slots()->begin(); (!slot) && (it != ship->slots()->end()); ++it) {
+ if (((*it)->type() == weapon->slot_type()) && !(*it)->has_flag(core::Slot::Mounted)) {
slot = (*it);
}
}