ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/maps/perl/chat.ext
(Generate patch)

Comparing deliantra/maps/perl/chat.ext (file contents):
Revision 1.2 by root, Sun May 7 07:57:04 2006 UTC vs.
Revision 1.4 by root, Sun May 7 08:05:26 2006 UTC

1#! perl 1#! perl
2
3cf::register_command chat => 0, sub { 2cf::register_command chat => 0, sub
3{
4 my ($who, $msg) = @_; 4 my ($who, $msg) = @_;
5 5
6 if ($msg) { 6 if ($msg) {
7 my $name = $who->name; 7 my $name = $who->name;
8 8
9 for my $player (cf::player::list) {
10 $player->ob->message ("$name chats: $msg", cf::NDI_BLUE) 9 $_->ob->message ("$name chats: $msg", cf::NDI_BLUE)
11 unless $player->ob->{ext_ignore_shout}; 10 for grep !$player->ob->{ext_ignore_shout}, cf::player::list;
12 }
13 11
14 } else { 12 } else {
15 $who->message ("Chat what?", cf::NDI_UNIQUE); 13 $who->message ("Chat what?", cf::NDI_UNIQUE);
16 } 14 }
17}; 15};
18 16
19cf::register_command shout => 0, sub { 17cf::register_command shout => 0, sub
18{
20 my ($who, $msg) = @_; 19 my ($who, $msg) = @_;
21 20
22 if ($msg) { 21 if ($msg) {
23 my $name = $who->name; 22 my $name = $who->name;
24 23
25 for my $player (cf::player::list) {
26 $player->ob->message ("$name shouts: $msg", cf::NDI_RED) 24 $_->ob->message ("$name shouts: $msg", cf::NDI_RED)
27 unless $player->ob->{ext_ignore_shout}; 25 for grep !$player->ob->{ext_ignore_shout}, cf::player::list;
28 } 26
29 } else { 27 } else {
30 $who->message ("Shout what?", cf::NDI_UNIQUE); 28 $who->message ("Shout what?", cf::NDI_UNIQUE);
31 } 29 }
32 30
33}; 31};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines