diff options
Diffstat (limited to 'src/client/map.cc')
-rw-r--r-- | src/client/map.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/client/map.cc b/src/client/map.cc index 34dcb40..46f96fd 100644 --- a/src/client/map.cc +++ b/src/client/map.cc @@ -244,11 +244,11 @@ void Map::draw() gl::end(); gl::disable(GL_TEXTURE_2D); - if (map_target != current_target) { + if (map_target != current_target ) { // this makes sure the map target exists set_target(current_target); - } else if (map_infotimestamp && map_inforecord && (map_infotimestamp != map_inforecord->timestamp())) { + } else if (map_inforecord && (map_infotimestamp != map_inforecord->timestamp())) { set_target(map_target); } } @@ -265,7 +265,10 @@ void Map::set_target(const core::Entity *entity) { map_targetlabel->set_text(map_target->name()); map_targetlabel->show(); - map_inforecord = map_target->info(); + if (map_target->info()) + map_inforecord = core::game()->info(map_target->info()->id()); + else + map_inforecord = 0; if (map_inforecord) { for (core::Info::Text::const_iterator it = map_inforecord->text().begin(); it != map_inforecord->text().end(); it++) { @@ -274,6 +277,7 @@ void Map::set_target(const core::Entity *entity) { map_infotimestamp = map_inforecord->timestamp(); } else { map_infotext.push_back("Information is not available"); + map_infotimestamp = 0; } map_scrollpane->show(); |