|
|
|
@ -327,7 +327,18 @@ void Autowalker::process_move(Pathing& paths) { |
|
|
|
|
|
|
|
|
|
rotate_player(current, target); |
|
|
|
|
|
|
|
|
|
// what are we aiming at?
|
|
|
|
|
auto aimed_at = fsm.$main_ui.camera_aim(); |
|
|
|
|
|
|
|
|
|
if(aimed_at && fsm.$level.world->has<components::InventoryItem>(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); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|