@prog apt-floor-fixup.muf 1 999 d 1 i : say me @ swap notify ; : find-exit-to (fromdbref todbref -- exitdbref or #-1) swap exits begin dup while (to e) dup linkcount 1 = if dup getlink (to e l) 3 pick dbcmp if swap pop exit then then next loop pop pop #-1 ; : main dup not if pop "Must give highest room number" say exit then 1 swap atoi 1 for intostr loc @ over rmatch dup exit? not if pop " *** isn't an exit" strcat say continue then dup linkcount 1 != if pop " *** has other than one link" strcat say continue then dup "k" flag? not if over " isn't set K (fixed)" strcat say dup "k" set then getlink dup room? not if pop " *** isn't linked to a room" strcat say continue then dup "k" flag? not if over " link-to room isn't set K (fixed)" strcat say dup "k" set then dup loc @ find-exit-to dup not if 3 pick " *** link-to room has no exit back" strcat say else dup "k" flag? not eif 3 pick " exit back isn't set K (fixed)" strcat say dup "k" set then pop dup location loc @ location dbcmp if pop pop continue then dup location loc @ location location dbcmp not if pop " *** is parented weird" strcat say continue then over " link-to room is parented wrong (fixed)" strcat say loc @ location moveto pop loop ; . c q