ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/cfplus.ext
(Generate patch)

Comparing deliantra/server/ext/cfplus.ext (file contents):
Revision 1.1 by root, Fri Dec 15 19:29:18 2006 UTC vs.
Revision 1.3 by root, Thu Dec 21 22:41:34 2006 UTC

65=cut 65=cut
66 66
67cf::register_extcmd lookat => sub { 67cf::register_extcmd lookat => sub {
68 my ($pl, $msg) = @_; 68 my ($pl, $msg) = @_;
69 my ($dx, $dy) = @$msg{qw(dx dy)}; 69 my ($dx, $dy) = @$msg{qw(dx dy)};
70
71 return unless $pl->ob && $pl->ob->map;
70 72
71 my $near = (abs $dx) <= 2 && (abs $dy) <= 2; 73 my $near = (abs $dx) <= 2 && (abs $dy) <= 2;
72 74
73 my %res; 75 my %res;
74 76
96 98
97cf::register_extcmd npc_dialog_begin => sub { 99cf::register_extcmd npc_dialog_begin => sub {
98 my ($pl, $msg) = @_; 100 my ($pl, $msg) = @_;
99 my ($id, $dx, $dy) = @$msg{qw(msgid dx dy)}; 101 my ($id, $dx, $dy) = @$msg{qw(msgid dx dy)};
100 102
103 return unless $pl->ob && $pl->ob->map;
101 return unless (abs $dx) <= 2 && (abs $dy) <= 2; 104 return unless (abs $dx) <= 2 && (abs $dy) <= 2;
102 return unless $pl->cell_visible ($dx, $dy); 105 return unless $pl->cell_visible ($dx, $dy);
103 106
104 for my $npc ($pl->ob->map->at ($pl->ob->x + $dx, $pl->ob->y + $dy)) { 107 for my $npc ($pl->ob->map->at ($pl->ob->x + $dx, $pl->ob->y + $dy)) {
105 if (NPC_Dialogue::has_dialogue $npc) { 108 if (NPC_Dialogue::has_dialogue $npc) {
146 delete $dialog{$msg->{msgid}}; 149 delete $dialog{$msg->{msgid}};
147 150
148 () 151 ()
149}; 152};
150 153
151cf::attach_to_players 154cf::player->attach (
152 on_logout => sub { 155 on_logout => sub {
153 my ($pl) = @_; 156 my ($pl) = @_;
154 157
155 delete $dialog{$_} for grep $pl->ob == $dialog{$_}{ob}, keys %dialog; 158 delete $dialog{$_} for grep $pl->ob == $dialog{$_}{ob}, keys %dialog;
156 }, 159 },
157; 160);
158 161
159=item ... = extcmd editor_support 162=item ... = extcmd editor_support
160 163
161Returns the value required by clients that have an editor to download and 164Returns the value required by clients that have an editor to download and
162upload maps from/to the server. 165upload maps from/to the server.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines