Skip to content

Commit

Permalink
Fix RandomCardPicker weight list shallow copy
Browse files Browse the repository at this point in the history
  • Loading branch information
Katy Coe committed May 5, 2016
1 parent 018ba22 commit a40c3b7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fireplace/dsl/random_picker.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ def __repr__(self):
# select number of cards to fetch
def __mul__(self, other):
ret = copy(self)
ret.weight = list(self.weights)
ret.weightedfilters = list(self.weightedfilters)
ret.count = other
return ret

# add a filter set
def copy_with_weighting(self, weight, **filters):
ret = copy(self)
ret.weights = list(self.weights)
ret.weights.append(weight)
ret.weightedfilters = list(self.weightedfilters)
ret.weightedfilters.append(filters)
return ret

Expand Down

0 comments on commit a40c3b7

Please sign in to comment.