diff --git a/autowalker.cpp b/autowalker.cpp index 50fcfa7..386f1b0 100644 --- a/autowalker.cpp +++ b/autowalker.cpp @@ -327,7 +327,18 @@ void Autowalker::process_move(Pathing& paths) { rotate_player(current, target); - send_event(gui::Event::MOVE_FORWARD); + // what are we aiming at? + auto aimed_at = fsm.$main_ui.camera_aim(); + + if(aimed_at && fsm.$level.world->has(aimed_at)) { + // NOTE: if we're aiming at an item then pick it up + // for now just loot it then close to get it off the map + send_event(gui::Event::LOOT_ITEM); + send_event(gui::Event::LOOT_OPEN); + } else { + send_event(gui::Event::MOVE_FORWARD); + } + while(fsm.in_state(gui::State::MOVING)) send_event(gui::Event::TICK); }