summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ng-input.cc
diff options
context:
space:
mode:
authorHaran Pilpel <haranp@users.sourceforge.net>2010-01-13 12:08:41 +0200
committerHaran Pilpel <haranp@users.sourceforge.net>2010-01-13 12:08:41 +0200
commit526626fe4e3c9bd87234d9b8701a5cfdb19ad7b8 (patch)
tree3341012879e5c2d086744d9f269c7c2702805b93 /crawl-ref/source/ng-input.cc
parentcce3c6e018e1ec88a1b49eaf2fbfde88f51ada01 (diff)
downloadcrawl-ref-526626fe4e3c9bd87234d9b8701a5cfdb19ad7b8.tar.gz
crawl-ref-526626fe4e3c9bd87234d9b8701a5cfdb19ad7b8.zip
Fix line_reader crashing at random on non-tiles build. This is #ifdefed out for
tiles. This is a hack.
Diffstat (limited to 'crawl-ref/source/ng-input.cc')
-rw-r--r--crawl-ref/source/ng-input.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/crawl-ref/source/ng-input.cc b/crawl-ref/source/ng-input.cc
index 499a3e2143..4a097049f8 100644
--- a/crawl-ref/source/ng-input.cc
+++ b/crawl-ref/source/ng-input.cc
@@ -178,17 +178,15 @@ static bool _read_player_name(std::string &name,
if (ret == CK_ESCAPE)
return (false);
- if (ret != CK_ESCAPE && existing.size())
+ if (!existing.empty())
{
menu.set_search(name);
menu.show();
const MenuEntry *sel = menu.selected_entry();
if (sel)
{
- const player_save_info &p =
- *static_cast<player_save_info*>( sel->data );
- name = p.name;
- return (true);
+ name = static_cast<player_save_info*>(sel->data)->name;
+ return true;
}
}