} 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");
}
}