diff options
author | Stijn Buys <ingar@osirion.org> | 2013-01-01 16:16:59 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2013-01-01 16:16:59 +0000 |
commit | d3ed23de89a7c1ddbb92990eee966966ee8fbeee (patch) | |
tree | b3c48b0b8d2ca3ef847a25746b7fc0fe7505cfef /src/game/base/game.cc | |
parent | 614ce1267772d67825a32fb7495a049cd6498fe5 (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.cc | 6 |
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); } } |