From c62fe609a69058e2e30f757e9a06f72a98464232 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Fri, 17 Sep 2010 15:19:34 +0000 Subject: Bump network protocol version to 19, menudescriptions use the info infrastructure, client-side lazy info update requests. Updated ROADMAP --- src/client/map.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/client/map.cc') 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(); -- cgit v1.2.3