--- deliantra/maps/perl/chat.ext 2006/05/07 07:54:15 1.1 +++ deliantra/maps/perl/chat.ext 2006/05/07 07:57:04 1.2 @@ -1,36 +1,30 @@ #! perl -cf::register_command chat => 0, sub -{ + +cf::register_command chat => 0, sub { my ($who, $msg) = @_; if ($msg) { my $name = $who->name; - my $player = cf::player::first; - while ($player) { - unless ($player->ob->{ext_ignore_shout}) { - $player->ob->message ("$name chats: $msg", cf::NDI_BLUE); - } - $player = cf::player::next $player; + for my $player (cf::player::list) { + $player->ob->message ("$name chats: $msg", cf::NDI_BLUE) + unless $player->ob->{ext_ignore_shout}; } + } else { $who->message ("Chat what?", cf::NDI_UNIQUE); } }; -cf::register_command shout => 0, sub -{ +cf::register_command shout => 0, sub { my ($who, $msg) = @_; if ($msg) { my $name = $who->name; - my $player = cf::player::first; - while ($player) { - unless ($player->ob->{ext_ignore_shout}) { - $player->ob->message ("$name shouts: $msg", cf::NDI_RED); - } - $player = cf::player::next $player; + for my $player (cf::player::list) { + $player->ob->message ("$name shouts: $msg", cf::NDI_RED) + unless $player->ob->{ext_ignore_shout}; } } else { $who->message ("Shout what?", cf::NDI_UNIQUE);