#!/usr/bin/perl 
# Avatars attacking without a specified weapon use unarmed attacks unless
# they have previously wielded a weapon.
#use Mooix::Thing;
#use Mooix::Root;
run sub {
	my $this=shift;
	%_=@_;

	# Make sure that this command is not spoofed, just in case.
        if ($_{avatar} != $this) {
		fail "No!"; 
	}
	
	if (! $this->combat_ok) {
		fail "You decide not to hurt anything after all.";
	}
	
	my $weapon = $this->weapon;
	
	if (! $weapon) {
		$this->exec->super(@_);
	}
	else {
		$weapon->exec->attack_verb(@_);
	}
}
