diff options
author | Stijn Buys <ingar@osirion.org> | 2013-11-11 00:41:33 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2013-11-11 00:41:33 +0000 |
commit | 7bdab72e2ddf145a4692ae92b22110c2e7febe67 (patch) | |
tree | 1d23b5cd5bdb6770b76e1a68ed651d30d6cab22c /src/game/base/game.cc | |
parent | 8039544940b6145dcc8c63bcd4e06073ed61801e (diff) |
Support for station weapons.
Diffstat (limited to 'src/game/base/game.cc')
-rw-r--r-- | src/game/base/game.cc | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/game/base/game.cc b/src/game/base/game.cc index 54c59b7..f41b9b2 100644 --- a/src/game/base/game.cc +++ b/src/game/base/game.cc @@ -2245,7 +2245,7 @@ bool Game::load_zone(core::Zone *zone) zoneini.unknown_error("weapon type '" + strval + "' is not a turret"); } else { patrol_npctype->set_turret(turret); - } + } } else { zoneini.unknown_key(); } @@ -2303,6 +2303,24 @@ bool Game::load_zone(core::Zone *zone) } else { shipmodel->apply(station); } + } else if (zoneini.got_key_label("cannon", strval)) { + Weapon *cannon = Weapon::find(strval); + if (!cannon) { + zoneini.unknown_error("unknown weapon type '" + strval + "'"); + } else if (cannon->subtype() != Weapon::Cannon) { + zoneini.unknown_error("weapon type '" + strval + "' is not a cannon"); + } else { + station->set_cannon(cannon); + } + } else if (zoneini.got_key_label("turret", strval)) { + Weapon *turret = Weapon::find(strval); + if (!turret) { + zoneini.unknown_error("unknown weapon type '" + strval + "'"); + } else if (turret->subtype() != Weapon::Turret) { + zoneini.unknown_error("weapon type '" + strval + "' is not a turret"); + } else { + station->set_turret(turret); + } } else { zoneini.unknown_key(); } |