Skip to content

Commit

Permalink
Fixed escape mode logic with invalid maps
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohann Ferreira committed Jul 5, 2018
1 parent f9ad647 commit 3ebe54a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/modes/map/map_escape.cpp
Expand Up @@ -79,19 +79,17 @@ void EscapeSupervisor::Initialize(const vt_map::MapLocation& map_location)
_escape_window.Show();

_location_valid = _map_location.IsValid();
if (!_location_valid) {
if (!_location_valid || !_LoadMapLocationPreview()) {
_action_options.EnableOption(1, false);
_action_options.SetSelection(0);

// Set a default text in that case
_map_hud_name.SetText(vt_system::UTranslate("No available destination"));
return;
}
// If valid, attempt to add the map image and texts
_action_options.EnableOption(1, true);
_action_options.SetSelection(1);

// If valid, attempt to add the map image and texts
_LoadMapLocationPreview();
}

void EscapeSupervisor::Update()
Expand Down

0 comments on commit 3ebe54a

Please sign in to comment.