From 0c4caaaac1ce801a1168da6634cb439b9f78eedb Mon Sep 17 00:00:00 2001 From: div0 Date: Tue, 9 Jun 2009 07:35:04 +0000 Subject: [PATCH] fix bot allocation. fugue c minor now is 9 bots. git-svn-id: svn://svn.icculus.org/nexuiz/trunk@6937 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- misc/tools/midi2cfg.pl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/misc/tools/midi2cfg.pl b/misc/tools/midi2cfg.pl index ea2fcc6ee..7451ecbe3 100644 --- a/misc/tools/midi2cfg.pl +++ b/misc/tools/midi2cfg.pl @@ -101,7 +101,7 @@ sub busybot_findfree($$$) return $bot; } return $l->[$_] if - $l->[$_]{channel} == $vchannel + (($vchannel < 16) || ($l->[$_]{channel} == $vchannel)) && !$l->[$_]{busy} && @@ -148,7 +148,7 @@ sub busybot_setbuttonsandadvance($$$) my $b0 = $bot->{curbuttons}; my $press = $b & ~$b0; my $release = $b0 & ~$b; - busybot_advance $bot => $t - 0.1 + busybot_advance $bot => $t - 0.10 if $release & (32 | 64); print "r $bot->{id} attack1\n" if $release & 32; print "r $bot->{id} attack2\n" if $release & 64; @@ -281,8 +281,11 @@ sub note_on($$$) $bot->{busy} = 1; $bot->{note} = $note; $bot->{busytime} = $t + 0.25; - busybot_stopnoteandadvance $bot => $t + 0.15, $note - if $staccato; + if($staccato) + { + busybot_stopnoteandadvance $bot => $t + 0.15, $note; + $bot->{busy} = 0; + } } } if($channel >= 16) -- 2.39.2