[Turn on line numbering]
arg type, @loc;
var all, event, status, source;
if (events && events.contains(type)) {
all = events[type];
events = events.del(type);
loc = loc ? loc[1] : .location();
for event in (all) {
[event, [status, source]] = event;
switch (source) {
case 'location:
(| loc.unhook_from_event(event) |);
case 'this:
(| .unhook_from_event(event) |);
default:
(| source.hook_into_event(event) |);
}
all = all.add(event, [0, source]);
}
events = events.add(type, all);
}
["// Created 16-Dec-1996 as a part of ColdCore, see: @help Credit"]