File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
src/libretro/drivers/options Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
14
14
15
15
### Fixed
16
16
17
- - Fixed a bug where logging invalid UTF-8 characters in ` UnformattedLogDriver ` would raise an exception.
17
+ - Fixed a bug where logging invalid UTF-8 characters in ` UnformattedLogDriver ` would raise an exception.
18
+ - Fixed a bug where fetching an unset option from a ` DictOptionDriver ` wouldn't register the default value for next time.
18
19
19
20
## [ 0.1.2] - 2024-05-31
20
21
Original file line number Diff line number Diff line change @@ -66,11 +66,13 @@ def get_variable(self, item: bytes) -> bytes | None:
66
66
# For invalid keys, return None
67
67
return None
68
68
69
- if key not in self ._variables :
70
- # For unset options, return the default value
71
- return string_at (self ._options_us [key ].default_value )
72
-
73
- value = self ._variables [key ]
69
+ if key in self ._variables :
70
+ # If we have a value for this option key...
71
+ value = self ._variables [key ]
72
+ else :
73
+ # Otherwise get the default value and save it to the dict
74
+ value = string_at (self ._options_us [key ].default_value )
75
+ self ._variables [key ] = value
74
76
75
77
if value not in (string_at (v .value ) for v in self ._options_us [key ].values if v .value ):
76
78
# For invalid values, return None
You can’t perform that action at this time.
0 commit comments