diff options
author | Stijn Buys <ingar@osirion.org> | 2010-11-13 14:25:39 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2010-11-13 14:25:39 +0000 |
commit | 871be21e83502a909620a5bcfcd09e3257ed0518 (patch) | |
tree | 8aee5b25fd5c3d43e55e1b92e114acca58c1172a /src/core/parser.cc | |
parent | 650cca5da5e15b9d4a85e7f734515f538b0cc0f3 (diff) |
corrected a bug where ship names got erased,
made core::Entity::info() const, added core::Info::find() to get non-const *core::Info pointers
Diffstat (limited to 'src/core/parser.cc')
-rw-r--r-- | src/core/parser.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/parser.cc b/src/core/parser.cc index 953cd50..22b2fc3 100644 --- a/src/core/parser.cc +++ b/src/core/parser.cc @@ -47,10 +47,13 @@ bool Parser::got_entity_key(filesystem::IniFile &inifile, core::Entity *entity) } } else if (inifile.got_key_string("info", strval)) { - if (!entity->info()) { - entity->set_info(new Info(Entity::infotype(), entity->label().c_str())); + + Info *info = Info::find(entity->info()); + if (!info) { + info = new Info(Entity::infotype(), entity->label().c_str()); + entity->set_info(info); } - entity->info()->add_text(strval); + info->add_text(strval); return true; } else if (inifile.got_key_label("label", strval)) { |