We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f51761b commit 23fa4c5Copy full SHA for 23fa4c5
1 file changed
addons/source-python/packages/source-python/menus/radio.py
@@ -91,14 +91,15 @@ def _slots_to_bin(slots):
91
:param iterable slots: Slots that should be enabled.
92
:raise ValueError: Raised if a slot is out of range.
93
"""
94
- result = 0
+ # Keys are enabled in that order: 0987654321
95
+ buffer = list('0000000000')
96
for slot in slots:
97
if 0 <= slot <= 9:
- result |= 1 << slot
98
+ buffer[~(slot - 1)] = '1'
99
else:
100
raise ValueError('Slot out of range: {}'.format(slot))
101
- return result
102
+ return int(''.join(buffer), 2)
103
104
def _select(self, player_index, choice_index):
105
"""See :meth:`menus.base._BaseMenu._select`."""
0 commit comments