From 94d4a403cbdbd007b34311edb8b054c838aa90ed Mon Sep 17 00:00:00 2001 From: Midgard Date: Mon, 24 Feb 2020 00:58:35 +0100 Subject: [PATCH] Fix price of common choices being inflated --- app/hlds/parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/hlds/parser.py b/app/hlds/parser.py index 9fa689a..a5e3e24 100644 --- a/app/hlds/parser.py +++ b/app/hlds/parser.py @@ -3,6 +3,7 @@ from glob import glob from os import path import itertools +from copy import deepcopy from typing import Iterable, List, Union, Tuple from tatsu import parse as tatsu_parse from tatsu.ast import AST @@ -28,7 +29,7 @@ class HldsSemanticActions: for dish in dishes: for i, choice in enumerate(dish.choices): if not isinstance(choice[1], Choice): - dish.choices[i] = (dish.choices[i][0], choices[choice[1]]) + dish.choices[i] = (dish.choices[i][0], deepcopy(choices[choice[1]])) # Move the base price to the first single choice if there is any first_single_choice = first(c[1] for c in dish.choices if c[0] == "single_choice")