#!/usr/bin/perl
#use Fcntl q{:flock};
#use Mooix::Thing;
run sub {
	my $this=shift;
	%_=@_;
	my $underprep=($this->under_prepositions)[0];
	foreach my $obj ($this->contents->list) {
		if (($obj->preposition)[0] eq $underprep) {
			# Lock the object for movement. Since it could have
			# moved while we were reading the contents list,
			# check its location after.
			# (FIXME There is also a race that an object could be
			# added to a container just as it is being moved,
			# and this loop would not see it.)
			my $lock = $obj->getlock(LOCK_EX);
			next if $obj->location != $this;
			$obj->physics->move(object => $obj, to => $_{oldloc});
		}
	}
}
