#!/usr/bin/perl
#use Mooix::Thing;
run sub {
	my $this=shift;
	
	# Don't clear fields on unpack if the weapon is wielded and has a
	# location (weilder) set. Do clear fields otherwise, and on object
	# creation too.
	if (! $this->defines("wielded") || ! ref $this->location) {
		foreach my $field (qw{wielded immobile}) {
			$this->$field(0);
			chmod(0664, $this->fieldfile($field)) || die "chmod $field: $!";
		}
	}
	return $this->super(@_);
}
