diff --git a/gui/fsm.cpp b/gui/fsm.cpp index 16503c9..5b747f3 100644 --- a/gui/fsm.cpp +++ b/gui/fsm.cpp @@ -198,6 +198,14 @@ namespace gui { case MOUSE_MOVE: mouse_action(true); break; + case AIM_CLICK: { + auto aimed_at = $main_ui.camera_aim(); + + if(aimed_at) { + // this will then send LOOT_ITEM if it's valid + System::pickup($level, aimed_at); + } + } break; default: break; // ignore everything else } @@ -465,17 +473,9 @@ namespace gui { case eGUI::INV_SELECT: event(Event::INV_SELECT, data); break; - case eGUI::AIM_CLICK: { - auto aimed_at = $main_ui.camera_aim(); - - if(aimed_at && !in_state(State::LOOTING)) { - // aimed at something and not looting so it's a pickup - System::pickup($level, aimed_at); - } else { - // otherwise just repeat the event and let the FSM deal - event(Event::AIM_CLICK); - } - } break; + case eGUI::AIM_CLICK: + event(Event::AIM_CLICK); + break; case eGUI::LOOT_ITEM: { dbc::check(world.has(entity), "INVALID LOOT_ITEM, that entity has no InventoryItem"); diff --git a/gui/main_ui.cpp b/gui/main_ui.cpp index 2bdbbd2..45970c3 100644 --- a/gui/main_ui.cpp +++ b/gui/main_ui.cpp @@ -103,7 +103,6 @@ namespace gui { $rayview.update_level($level); $rayview.position_camera(player.x + 0.5, player.y + 0.5); - // BUG #57: I think this is in the wrong direction? player_position.aiming_at = $rayview.aiming_at; $compass_dir = 0;