Skip to content

Commit

Permalink
No audit for credit switches during free play
Browse files Browse the repository at this point in the history
  • Loading branch information
avanwinkle committed Feb 22, 2024
1 parent 95cb0eb commit e38d079
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 1 addition & 3 deletions mpf/modes/match/code/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self, *args, **kwargs):
# add setting
self.machine.settings.add_setting(SettingEntry("match_percentage", "Match Percentage", 500,
"match_percentage", 10,
{0: "Disabled", 2: "2%", 5: "5%", 10: "10%", 15: "15%", 30: "30%",
{0: "Never", 2: "2%", 5: "5%", 10: "10%", 15: "15%", 30: "30%",
50: "50%"}, "standard"))

def _get_match_numbers(self):
Expand Down Expand Up @@ -53,8 +53,6 @@ async def _run(self) -> None:
return

match_percentage = self.machine.settings.get_setting_value("match_percentage")
if not match_percentage:
return

match_numbers = self._get_match_numbers()
winner_number = self._get_winner_number(match_numbers, match_percentage)
Expand Down
6 changes: 4 additions & 2 deletions mpf/plugins/auditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ def _load_defaults(self):
self.current_audits['missing_switches'] = dict()

# build the list of switches we should audit
self.switchnames_to_audit = {x.name for x in self.machine.switches.values()
if 'no_audit' not in x.tags}
is_free_play = self.machine.settings.get_setting_value('free_play')
self.switchnames_to_audit = {x.name for x in self.machine.switches.values() if
# Don't audit tagged switches, or credit switches during free play
('no_audit' not in x.tags) and ('no_audit_free' not in x.tags or not is_free_play)}

# Make sure we have all the switches in our audit dict
for switch_name in self.switchnames_to_audit:
Expand Down

0 comments on commit e38d079

Please sign in to comment.