screp: document unknown command 0x1B
[perl/schtarr.git] / screp
diff --git a/screp b/screp
index 4b1f033159b8614100d43d28a30f0b6121fdc7f2..5b69016fde9b4a44ba2ced17aa5755943b9a464c 100755 (executable)
--- a/screp
+++ b/screp
@@ -10,6 +10,8 @@ GetOptions(
        "verbose|v!" => \$SHOWWARN,
 );
 
+use constant { APM_FIRSTFRAME => 80 / .042 };
+
 {
 
 package Data::StarCraft::Replay;
@@ -310,6 +312,7 @@ my %cmdread = (
        0x18 => ["cancel"],
        0x19 => ["cancel hatch"],
        0x1A => ["stop", 1],
+#      0x1B => ["move-thing??"], # tim: after hotkey (unit, reaver??) select; soon after reselected and moved
        0x1E => ["return cargo", 1],
        0x1F => ["train", 2, \%unit],
        0x20 => ["cancel train", 2], # == 254
@@ -486,7 +489,7 @@ my %cmdmacro = map {$_ => 1} (
 my %stats; # player => count
 for (@$map) {
        $stats{$_->[1]}{actions}++;
-       $stats{$_->[1]}{gameactions}++ if $_->[0] > 80 / .042;
+       $stats{$_->[1]}{gameactions}++ if $_->[0] >= APM_FIRSTFRAME;
        $stats{$_->[1]}{last} = $_->[0] if $_->[2] eq "part";
        $stats{$_->[1]}{$cmdmacro{$_->[2]} ? "macro" : "micro"}++;
        $stats{$_->[1]}{count}{$_->[2]}++;
@@ -501,8 +504,7 @@ for my $player (sort keys %stats) {
                showtime($row->{last}),
 #              $row->{micro} / $row->{last} * 60 / .042 * 1.05,
 #              $row->{macro} / $row->{last} * 60 / .042 * 1.05,
-               $row->{gameactions} / $row->{last} * 60 / .042 * 1.042,
-       #       $row->{gameactions} / $map->[-1][0] * 60 / .042,
+               $row->{gameactions} / ($row->{last} - APM_FIRSTFRAME) * 60 / .042,
        );
 
        if (0) {