Re: [TADS] Moving stuf again...


10 Dec 1995 17:05:51 -0500

> Nice and simple code. Just a warning about all such code, though. I used
>a somewhat similar function once (though needlessly more baroque, of
>course)
>and didn't include any property checks for isworn and isfixed properties.
>Naturally this caused immense problems, as supposedly fixed items got
>moved around when they shouldn't have been.

Well, I'm using it to move the contents of objects that *can't* contain
fixed items (or better not, anyway), so it shouldn't be a problem. For
more general usage, though, yeah, it should be:

: moveFromTo: function (from, to)
{
local l, i;
l := from.contents;
for (i := 1; i <= length(l); ++i)
{
if (not l[i].isfixed and not l[i].isworn) l[i].moveInto(to);
}