Just use get_if here instead.

master
Zed A. Shaw 2 days ago
parent 8bbafc4d10
commit efdb0cb119
  1. 5
      gui/map_view.cpp

@ -73,14 +73,13 @@ namespace gui {
} }
void MapViewUI::update() { void MapViewUI::update() {
if($gui.has<Textual>($log_to)) { if(auto text = $gui.get_if<Textual>($log_to)) {
auto& text = $gui.get<Textual>($log_to);
//BUG: I'm calling this what it is, fix it //BUG: I'm calling this what it is, fix it
wstring log_garbage; wstring log_garbage;
for(auto msg : $messages) { for(auto msg : $messages) {
log_garbage += msg + L"\n"; log_garbage += msg + L"\n";
} }
text.update(log_garbage); text->update(log_garbage);
} }
} }

Loading…
Cancel
Save