--- deliantra/server/ext/chat.ext 2007/07/22 20:08:38 1.24 +++ deliantra/server/ext/chat.ext 2007/07/24 22:49:40 1.28 @@ -828,19 +828,21 @@ } } 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; + my $name = $ob->name; my $NOW = time; cf::LOG cf::llevDebug, sprintf "QBERT [%s] %s\n", $name, $msg; @@ -855,15 +857,17 @@ }; cf::register_command shout => sub { - my ($pl, $msg) = @_; + my ($ob, $msg) = @_; 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; - my $name = $pl->name; + my $name = $ob->name; cf::LOG cf::llevDebug, sprintf "QBERT {%s} %s\n", $name, $msg; send_irc ("\007\0034{%s} %s\n", $name, $msg); @@ -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);