if (current)
if (last)
{
- Context * dest =
- get_outlet ()->find_create_context (to_type, to_id, SCM_EOL);
- current->remove_context (last);
- dest->add_context (last);
+ Context * dest = 0;
+ Context * where = get_outlet ();
+ while (!dest && where)
+ {
+ dest = where->find_context_below (to_type, to_id);
+ where = where->daddy_context_;
+ }
+
+ if (dest)
+ {
+ current->remove_context (last);
+ dest->add_context (last);
+ }
+ else
+ {
+ get_music ()->origin ()->warning ("could not find context to switch to.");
+ }
}
else
{