]> ruin.nu Git - NDIRC.git/blobdiff - Commands/Scans.pm
Two minor fixes
[NDIRC.git] / Commands / Scans.pm
index 70420e9a33d100492b24f029bafe1cb71bf37052..ed0def8dc5af3bd3adfafe4c23497ac377b41ea2 100644 (file)
@@ -54,6 +54,10 @@ sub gs
 
        my $planet = $c->model->selectrow_array(q{SELECT planetid($1,$2,$3,tick())}
                ,undef,$x,$y,$z);
+       unless ($planet){
+               $c->reply("There is no planet with coords $x:$y:$z, try again after the tick.");
+               return;
+       }
 
        my $query = $c->model->prepare(q{SELECT scan_id
                FROM scans
@@ -194,9 +198,11 @@ sub anon
        my ($self, $c, $msg) = @_;
        my ($target,$mess) = $msg =~ /^(\S+) (.*)$/ or die 'ARGS';
 
-       $c->message("msg $target", "<b>$mess</b> <c04>(reply with /msg $ND::scanchan)</c>");
-       $c->message("msg $ND::scanchan", "<c03>$target << $mess</c>");
+       $c->message("msg $target", "<b>$mess</b> <c04>(reply with /msg "
+               .$c->channel.")</c>");
+       $c->message("msg ".$c->channel, "<c03>$target << $mess</c>");
 }
+
 sub addscan
        : Help(syntax: .addscan list of scans)
 {