Fix pfand/repeat

If both plugins were loaded at the same time, nothing would still work.
This commit is contained in:
Juerd Waalboer 2022-08-30 20:40:55 +02:00
parent 22ca2ec61e
commit 596c64136a

View file

@ -12,11 +12,11 @@ my $limit = 200;
my $err_limit = "Repetition is limited at $limit items.";
sub command($self, $cart, $command, @) {
return ABORT, $err_pfand if $cart->entries('is_pfand');
my ($lhs, $op, $rhs) = $command =~ /^(\d+)?([x*+-])(\d+)?$/
or return NEXT;
return ABORT, $err_pfand if $cart->entries('is_pfand');
my $last = ($cart->entries)[-1];
return NEXT if $lhs and $rhs; # 123x123 -> invalid syntax