--- deliantra/server/ext/chat.ext 2007/07/22 17:10:05 1.23 +++ deliantra/server/ext/chat.ext 2007/07/24 16:42:35 1.27 @@ -828,16 +828,18 @@ } } else { - $ob->contr->send_msg ($SAY_CHANNEL => "What do you want to say?", 0, reply => 1); + $ob->contr->ns->send_msg ($SAY_CHANNEL => "What do you want to say?", 0, reply => 1); } }; cf::register_command chat => sub { - my ($pl, $msg) = @_; + my ($ob, $msg) = @_; utf8::decode $msg; - return if $pl->contr->invoke (cf::EVENT_PLAYER_CHAT, $msg); + my $pl = $ob->contr; + + return if $pl->invoke (cf::EVENT_PLAYER_CHAT, $msg); if ($msg) { my $name = $pl->name; @@ -859,7 +861,9 @@ utf8::decode $msg; - return if $pl->contr->invoke (cf::EVENT_PLAYER_SHOUT, $msg); + my $pl = $ob->contr; + + return if $pl->invoke (cf::EVENT_PLAYER_SHOUT, $msg); if ($msg) { my $NOW = time; @@ -868,7 +872,7 @@ cf::LOG cf::llevDebug, sprintf "QBERT {%s} %s\n", $name, $msg; send_irc ("\007\0034{%s} %s\n", $name, $msg); - $_->ns->send_msg ($CHAT_CHANNEL => "$name shouts: $msg", cf::NDI_BLUE, $_ == $pl ? (reply => 1) : ()) + $_->ns->send_msg ($CHAT_CHANNEL => "$name shouts: $msg", cf::NDI_RED, $_ == $pl ? (reply => 1) : ()) for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 2 } cf::player::list; } else { @@ -914,7 +918,7 @@ } elsif ($other->ob->{ext_ignore_tell}{$name} >= time) { $ns->send_msg ($pl_channel => "$target ignores what you say. Give up on it.", reply => 1); } else { - return if $other->invoke (cf::EVENT_PLAYER_TOLD, $pl->contr, $msg); + return if $other->invoke (cf::EVENT_PLAYER_TOLD, $pl, $msg); cf::LOG cf::llevDebug, sprintf "TELL [%s>%s] %s\n", $name, $target, $msg; $ns->send_msg ($pl_channel => "You tell $target: $msg", reply => 1);