diff options
Diffstat (limited to 'src/game/game.cc')
-rw-r--r-- | src/game/game.cc | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/game/game.cc b/src/game/game.cc index 15ae029..6d85f0f 100644 --- a/src/game/game.cc +++ b/src/game/game.cc @@ -77,15 +77,15 @@ void func_buy(core::Player *player, std::string const &args) aux::to_lowercase(shipname); ShipModel *shipmodel = 0; - for (std::list<ShipModel *>::iterator smit = ShipModel::registry.begin(); smit != ShipModel::registry.end(); smit++) { - if (shipname == (*smit)->modelname()) { - shipmodel = (*smit); + for (ShipModel::iterator smit = ShipModel::registry.begin(); smit != ShipModel::registry.end(); smit++) { + if (shipname == (*smit).first) { + shipmodel = (*smit).second; break; } if (helpstr.size()) helpstr.append("^N|^B"); - helpstr.append((*smit)->modelname()); + helpstr.append((*smit).second->label()); } if (shipmodel) { @@ -168,7 +168,9 @@ void Game::init() while (worldini.getline()) { if (worldini.got_key()) { if (worldini.section().compare("star") == 0) { - if (worldini.got_key_string("name", star->entity_name)) + if (worldini.got_key_string("label", star->entity_label)) + continue; + else if (worldini.got_key_string("name", star->entity_name)) continue; else if (worldini.got_key_vector3f("location", star->entity_location )) continue; @@ -180,7 +182,9 @@ void Game::init() con_warn << worldini.name() << " unknown key '" << worldini.key() << "' at line " << worldini.line() << std::endl; } else if (worldini.section().compare("planet") == 0) { - if (worldini.got_key_string("name", planet->entity_name)) + if (worldini.got_key_string("label", planet->entity_label)) + continue; + else if (worldini.got_key_string("name", planet->entity_name)) continue; else if (worldini.got_key_string("texture", planet->entity_texture)) continue; @@ -196,7 +200,6 @@ void Game::init() } else if (worldini.section().compare("entity") == 0) { std::string shapename; - if (worldini.got_key_string("shape", shapename)) { if (shapename.compare("axis") == 0) { entity->entity_shape = core::Entity::Axis; @@ -210,7 +213,9 @@ void Game::init() con_warn << worldini.name() << " unknown shape '" << shapename << "' at line " << worldini.line() << std::endl; } continue; - } else if (worldini.got_key_string("name", entity->entity_name)) + } else if (worldini.got_key_string("label", entity->entity_label)) + continue; + else if (worldini.got_key_string("name", entity->entity_name)) continue; else if (worldini.got_key_string("model", entity->entity_modelname)) continue; @@ -265,8 +270,10 @@ void Game::init() while (shipsini.getline()) { if (shipsini.got_key()) { if (shipsini.section().compare("ship") == 0) { - - if (shipsini.got_key_string("name",shipmodel->shipmodel_name)) { + if (shipsini.got_key_string("label", shipmodel->shipmodel_label)) { + ShipModel::add(shipmodel); + continue; + } else if (shipsini.got_key_string("name",shipmodel->shipmodel_name)) { continue; } else if (shipsini.got_key_string("model", shipmodel->shipmodel_modelname)) { continue; |