… | |
… | |
52 | sub notify_players { |
52 | sub notify_players { |
53 | my (%sent_targets) = @_; |
53 | my (%sent_targets) = @_; |
54 | |
54 | |
55 | # lets message player ingame: this is a NEW feature from the perl IPO :-) |
55 | # lets message player ingame: this is a NEW feature from the perl IPO :-) |
56 | for (keys %sent_targets) { |
56 | for (keys %sent_targets) { |
57 | if (my $player = cf::player::find $_) { |
57 | if (my $player = cf::player::find_active $_) { |
58 | my $cnt = $sent_targets{$_}; |
58 | my $cnt = $sent_targets{$_}; |
59 | |
59 | |
60 | if ($cnt == 1) { |
60 | if ($cnt == 1) { |
61 | $player->ob->message ("You've got new mail."); |
61 | $player->ob->message ("You've got new mail."); |
62 | } else { |
62 | } else { |
… | |
… | |
167 | cf::register_script_function "ipo::command" => sub { |
167 | cf::register_script_function "ipo::command" => sub { |
168 | my ($who, $msg, $npc) = @_; |
168 | my ($who, $msg, $npc) = @_; |
169 | my ($cmd, $arguments) = split /\s+/, $msg, 2; |
169 | my ($cmd, $arguments) = split /\s+/, $msg, 2; |
170 | $cmd = lc $cmd; |
170 | $cmd = lc $cmd; |
171 | |
171 | |
172 | my $pl = cf::player::find $who->name; |
172 | my $pl = cf::player::find_active $who->name; |
173 | my ($x, $y) = ($pl->ob->x, $pl->ob->y); |
173 | my ($x, $y) = ($pl->ob->x, $pl->ob->y); |
174 | |
174 | |
175 | if (my $pr = $prices{$cmd}) { |
175 | if (my $pr = $prices{$cmd}) { |
176 | if ($cmd eq 'mailwarning' and !$who->flag (cf::FLAG_WIZ)) { |
176 | if ($cmd eq 'mailwarning' and !$who->flag (cf::FLAG_WIZ)) { |
177 | return 1; |
177 | return 1; |