From 871be21e83502a909620a5bcfcd09e3257ed0518 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 13 Nov 2010 14:25:39 +0000 Subject: corrected a bug where ship names got erased, made core::Entity::info() const, added core::Info::find() to get non-const *core::Info pointers --- src/core/parser.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/core/parser.cc') 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)) { -- cgit v1.2.3