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

Comparing deliantra/server/ext/map_lib.ext (file contents):
Revision 1.5 by elmex, Sat Feb 2 17:38:36 2008 UTC vs.
Revision 1.7 by elmex, Sat Mar 20 14:57:58 2010 UTC

9 9
10sub rec_inv_by_slaying { 10sub rec_inv_by_slaying {
11 my ($ob, $slaying, $cb) = @_; 11 my ($ob, $slaying, $cb) = @_;
12 $cb->($ob) if $ob->slaying eq $slaying; 12 $cb->($ob) if $ob->slaying eq $slaying;
13 for my $iob ($ob->inv) { rec_inv_by_slaying ($iob, $slaying, $cb) } 13 for my $iob ($ob->inv) { rec_inv_by_slaying ($iob, $slaying, $cb) }
14}
15
16=item count_linked ($map, $connected)
17
18Counts the number of objects with the connected value C<$connected> on
19the map C<$map>.
20
21=cut
22
23sub count_linked {
24 my ($map, $connected) = @_;
25 my (@a) = $map->find_link ($connected);
26 scalar @a
14} 27}
15 28
16=item object attachment: 'check_inventory_on_apply' 29=item object attachment: 'check_inventory_on_apply'
17 30
18This attachment checks on apply whether the applyer 31This attachment checks on apply whether the applyer
59 rec_inv_by_slaying ($pl, $cfg->{key_string}, sub { 72 rec_inv_by_slaying ($pl, $cfg->{key_string}, sub {
60 my ($ob) = @_; 73 my ($ob) = @_;
61 $match = $ob; 74 $match = $ob;
62 }); 75 });
63 if ($match) { 76 if ($match) {
64 $match->decrease_ob_nr ($cfg->{decrease_by_cnt}) if $cfg->{decrease_by_cnt}; 77 $match->decrease ($cfg->{decrease_by_cnt}) if $cfg->{decrease_by_cnt};
65 $pl->message ($cfg->{message_on_match}, cf::NDI_UNIQUE) if defined $cfg->{message_on_match}; 78 $pl->message ($cfg->{message_on_match}, cf::NDI_UNIQUE) if defined $cfg->{message_on_match};
66 } else { 79 } else {
67 $pl->message ($cfg->{message_on_nomatch}, cf::NDI_RED | cf::NDI_UNIQUE) if defined $cfg->{message_on_nomatch}; 80 $pl->message ($cfg->{message_on_nomatch}, cf::NDI_RED | cf::NDI_UNIQUE) if defined $cfg->{message_on_nomatch};
68 cf::override; 81 cf::override;
69 } 82 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines