… | |
… | |
68 | |
68 | |
69 | sub create_object { |
69 | sub create_object { |
70 | my ($name, $map, $x, $y, $cb, @a) = @_; |
70 | my ($name, $map, $x, $y, $cb, @a) = @_; |
71 | my $o = cf::object::new $name; |
71 | my $o = cf::object::new $name; |
72 | my $r = $cb->($o, @a); |
72 | my $r = $cb->($o, @a); |
73 | $map->insert_object ($o, $x, $y); |
73 | $map->insert ($o, $x, $y); |
74 | $r |
74 | $r |
75 | } |
75 | } |
76 | |
76 | |
77 | # this handler notifies the player of new mail |
77 | # this handler notifies the player of new mail |
78 | cf::player->attach ( |
78 | cf::player->attach ( |
… | |
… | |
230 | |
230 | |
231 | my $cnt; |
231 | my $cnt; |
232 | for ($who->inv) { |
232 | for ($who->inv) { |
233 | if ($_->name () =~ /^(bag|package|carton) T: \Q$arguments\E F: (\S+)$/) { |
233 | if ($_->name () =~ /^(bag|package|carton) T: \Q$arguments\E F: (\S+)$/) { |
234 | $_->name ("$1 F: $2 T: $arguments"); |
234 | $_->name ("$1 F: $2 T: $arguments"); |
235 | $_->teleport ($storage, 2, 2); |
235 | $storage->insert ($_, 2, 2); |
|
|
236 | $who->esrv_del_item ($_->count); |
236 | $cnt++; |
237 | $cnt++; |
237 | } |
238 | } |
238 | } |
239 | } |
239 | |
240 | |
240 | if ($cnt) { |
241 | if ($cnt) { |