parse-wormedit: bytes declarable as non-capturing
[wormy.git] / parse-wormedit
index 3811863103ea42ea4719a1310eca52e4852b89b1..81c073418c9d1c11f86e956867ec1bba20e9ed9e 100755 (executable)
@@ -50,7 +50,8 @@ my @FORMAT = (
                        multifood  => 'C',
                        timematch  => 'C',
                        race       => 'C',
-                       ctf        => 'Cx',
+                       ctf        => 'C',
+                       reserved   => 'x',
                ],
        ],
        sprite     => ['8C',
@@ -59,7 +60,8 @@ my @FORMAT = (
        finish      => [1,
                type    => 's',
                message => 'Ca255',
-               code    => 'Ca255x256',
+               code    => 'Ca255',
+               reserved=> 'x256',
        ],
        hiname      => 'a3',
        levels      => ['*', # levelcount->total actually
@@ -130,12 +132,11 @@ sub read {
        given ($fileversion) {
                when (153) { } # current @FORMAT
                        $FORMAT[7] = 'Ca64'; # no reserved space after description
-                       $FORMAT[15]->[-1] = 'Ca255'; # enddata
+                       splice @{ $FORMAT[15] }, -2; # finish reserve
                        $FORMAT[-1]->[-1]->[0] = '32C'; # less objects
-               when ($version == 96) {
-                       ref $_ and $_->[-1] = 'C' for @{ $FORMAT[11] }; # 9 moderefs
-               }
-                       ref $_ and pop @$_ for @{ $FORMAT[11] }; # only 8 moderefs
+                       ref $_ and pop @$_ for @{ $FORMAT[11] }; # 9 moderefs
+               when ($version == 96) { }
+                       ref $_ and pop @$_ for @{ $FORMAT[11] }; # only 8 moderefs (no ctf)
                        splice @FORMAT, 6, 2 if $version <= 94;  # earlier version without description
                when (95) { }
                        splice @{ $FORMAT[7] }, 4, 2;  # no race
@@ -216,7 +217,7 @@ sub read {
                        ) }
                        [qw/single peaworm tron deathmatch foodmatch multifood timematch race ctf/]
                ],
-               theanswer => 'C', # 42
+               theanswer => 'x', # 42
                sprite     => ['C',
                        line => 'B8',
                ],