]> git.rm.cloudns.org Git - xonotic/xonotic.git/commitdiff
stay more on the same bot with a channel
authorRudolf Polzer <divverent@alientrap.org>
Tue, 27 Sep 2011 09:05:06 +0000 (11:05 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 27 Sep 2011 09:05:16 +0000 (11:05 +0200)
misc/tools/midi2cfg-ng.pl

index 1111f468ee3f951d1f63eb806dfbe389abbf8dbc..52dbd3a98636fb7f0d5fea2bc8a235b63e8884e0 100755 (executable)
@@ -473,10 +473,19 @@ sub busybot_note_on_bot($$$$$$$)
        }
        ++$bot->{seen}{$k0}{$k1};
 
+       if($bot->{lastuse} && $channel == $bot->{lastchannel})
+       {
+               $bot->{lastchannelsequence} += 1;
+       }
+       else
+       {
+               $bot->{lastchannelsequence} = 1;
+       }
        $bot->{lastuse} = $time;
        $bot->{lastchannel} = $channel;
-       $bot->{lastprogram} = $program;
-       $bot->{lastnote} = $note;
+
+#      print STDERR "$time $bot->{id} $channel:$note\n"
+#              if $channel == 11;
 
        return 1;
 }
@@ -534,15 +543,7 @@ sub botsort($$$$@)
                        {
                                if($channel == $_->{lastchannel})
                                {
-                                       ++$q;
-                                       if($program == $_->{lastprogram})
-                                       {
-                                               ++$q;
-                                               if($note == $_->{lastnote})
-                                               {
-                                                       ++$q;
-                                               }
-                                       }
+                                       $q += $_->{lastchannelsequence};
                                }
                                else
                                {