Fix the map opening and closing all the time.
This commit is contained in:
parent
a11e7de14e
commit
0c8cb197c2
3 changed files with 11 additions and 5 deletions
|
@ -244,11 +244,17 @@ void Autowalker::craft_weapon() {
|
|||
}
|
||||
|
||||
void Autowalker::open_map() {
|
||||
if(map_opened_once) return;
|
||||
if(!map_opened_once) {
|
||||
if(!fsm.$map_open) {
|
||||
send_event(gui::Event::MAP_OPEN);
|
||||
map_opened_once = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!fsm.$map_open) {
|
||||
void Autowalker::close_map() {
|
||||
if(fsm.$map_open) {
|
||||
send_event(gui::Event::MAP_OPEN);
|
||||
map_opened_once = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -272,7 +278,7 @@ void Autowalker::autowalk() {
|
|||
handle_boss_fight();
|
||||
handle_player_walk(start, goal);
|
||||
|
||||
if(map_opened_once && move_attempts > 20) send_event(gui::Event::MAP_OPEN);
|
||||
close_map();
|
||||
|
||||
move_attempts++;
|
||||
} while(move_attempts < 100 && fsm.autowalking);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue