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

Comparing deliantra/server/ext/dmcommands.ext (file contents):
Revision 1.26 by root, Mon Nov 26 15:12:16 2012 UTC vs.
Revision 1.27 by root, Fri Jan 11 15:08:03 2013 UTC

201cf::register_command reset => sub { 201cf::register_command reset => sub {
202 my ($ob, $arg) = @_; 202 my ($ob, $arg) = @_;
203 203
204 return unless $ob->may ("command_reset"); 204 return unless $ob->may ("command_reset");
205 205
206 my $unique = $arg =~ s/^\s*--unique\s*//;
207
206 my $map = $ob->map; 208 my $map = $ob->map;
207 209
208 my @pl = $map->players; 210 my @pl = $map->players;
209 $_->enter_link for @pl; 211 $_->enter_link for @pl;
210 cf::async { 212 cf::async {
211 my $name = $map->visible_name; 213 my $name = $map->visible_name;
212 $Coro::current->{desc} = "reset $name"; 214 $Coro::current->{desc} = "reset $name";
213 215
216 $map->clear_unique_items if $unique;
214 $map->reset; 217 $map->reset;
218
215 $_->leave_link for @pl; 219 $_->leave_link for @pl;
216 220
217 $ob->reply (undef, "$name was reset."); 221 $ob->reply (undef, "$name was reset.");
218 }; 222 };
219 223

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines