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.14 by root, Sat Dec 13 20:34:37 2008 UTC vs.
Revision 1.15 by root, Mon Oct 26 02:34:37 2009 UTC

190 my ($pl) = @_; 190 my ($pl) = @_;
191 191
192 delete $pl->{npc_dialog}; 192 delete $pl->{npc_dialog};
193 $pl->detach ("npc_dialog_active"); 193 $pl->detach ("npc_dialog_active");
194 }, 194 },
195 on_map_change => sub {
196 my ($pl) = @_;
197
198 my $dialog = delete $pl->{npc_dialog}
199 or return;
200
201 $pl->ext_msg ($dialog->{id} => error => "out of range");
202 $pl->detach ("npc_dialog_active");
203 },
195 on_move => sub { 204 on_move => sub {
196 my ($pl, $dir) = @_; 205 my ($pl, $dir) = @_;
197 206
198 # must delay a bit :/ 207 # must delay a bit :/
199 my $delay; $delay = EV::timer 0, 0, sub { 208 my $delay; $delay = EV::timer 0, 0, sub {
202 if (my $dialog = $pl->{npc_dialog}) { 211 if (my $dialog = $pl->{npc_dialog}) {
203 my (undef, $dx, $dy) = $pl->ob->rangevector ($dialog->{npc}); 212 my (undef, $dx, $dy) = $pl->ob->rangevector ($dialog->{npc});
204 213
205 return if (abs $dx) <= 2 && (abs $dy) <= 2; 214 return if (abs $dx) <= 2 && (abs $dy) <= 2;
206 215
216 delete $pl->{npc_dialog};
207 $pl->ext_msg ($dialog->{id} => error => "out of range"); 217 $pl->ext_msg ($dialog->{id} => error => "out of range");
218 $pl->detach ("npc_dialog_active");
208 } 219 }
209
210 delete $pl->{npc_dialog};
211 $pl->detach ("npc_dialog_active");
212 }; 220 };
213 }, 221 },
214; 222;
215 223
216cf::player->attach ( 224cf::player->attach (

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines