From: John Tsiombikas Date: Wed, 17 Jan 2018 14:42:03 +0000 (+0200) Subject: picking up exhibits works again with the slot mechanism X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=commitdiff_plain;h=3c48aa0de66e0b89b674d353eb6c84b2c9276013 picking up exhibits works again with the slot mechanism --- diff --git a/src/app.cc b/src/app.cc index 8865012..d4b516e 100644 --- a/src/app.cc +++ b/src/app.cc @@ -648,17 +648,19 @@ void app_mouse_button(int bn, bool pressed, int x, int y) } else { if(exsel_grab_mouse) { // cancel grab on mouse release - debug_log("releasing...\n"); Exhibit *ex = exsel_grab_mouse.ex; Vec3 pos = exslot_mouse.node.get_position(); - debug_log("release location: %g %g %g\n", pos.x, pos.y, pos.z); - ExhibitSlot *slot = exman->nearest_empty_slot(pos); + debug_log("releasing at %g %g %g ...\n", pos.x, pos.y, pos.z); + + exslot_mouse.detach_exhibit(); + + ExhibitSlot *slot = exman->nearest_empty_slot(pos, 100); if(!slot) { - debug_log("no nearby slot\n"); + debug_log("no empty slot nearby\n"); if(ex->prev_slot && ex->prev_slot->empty()) { slot = ex->prev_slot; - debug_log("previous slot available though\n"); + debug_log("using previous slot"); } }