diff options
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/buymenu.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/client/buymenu.cc b/src/client/buymenu.cc index 7fad916..d708511 100644 --- a/src/client/buymenu.cc +++ b/src/client/buymenu.cc @@ -83,21 +83,21 @@ void BuyMenu::set_item(std::string const & itemtype, std::string const & itemnam menu_namelabel->set_text(0); menu_modelview->set_modelname(0); - core::Info *info = core::game()->info(menu_itemtype, menu_itemname); - if (info) { - menu_namelabel->set_text(info->name()); - menu_modelview->set_modelname(info->modelname()); + menu_inforecord = core::game()->info(menu_itemtype, menu_itemname); + + if (menu_inforecord) { + menu_namelabel->set_text(menu_inforecord->name()); + menu_modelview->set_modelname(menu_inforecord->modelname()); - for (core::Info::Text::iterator it = info->text().begin(); it != info->text().end(); it++) { + for (core::Info::Text::iterator it = menu_inforecord->text().begin(); it != menu_inforecord->text().end(); it++) { menu_infotext.push_back((*it)); } - menu_infotimestamp = info->timestamp(); + menu_infotimestamp = menu_inforecord->timestamp(); } else { menu_infotext.push_back("Information is not available"); menu_infotimestamp = 0; + menu_inforecord = 0; } - - menu_inforecord = info; } void BuyMenu::resize() @@ -136,7 +136,7 @@ void BuyMenu::resize() void BuyMenu::draw() { // update content if necessary - if (menu_infotimestamp && (menu_infotimestamp != menu_inforecord->timestamp())) + if (menu_infotimestamp && menu_inforecord && (menu_infotimestamp != menu_inforecord->timestamp())) set_item(menu_itemtype, menu_itemname); } |