Skip to content

Commit a9d1d2e

Browse files
committed
CHANGES:
- MizEdit: variables support constants now
1 parent d47324a commit a9d1d2e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

core/mizfile.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,10 +528,8 @@ def check_where(reference: dict, config: Union[list, str], debug: bool, **kwargs
528528
elif isinstance(value, str):
529529
if value.startswith('$'):
530530
kwargs[name] = utils.evaluate(value, **kwargs)
531-
elif '/' in value:
532-
kwargs[name] = next(utils.for_each(source, value.split('/'), debug=debug, **kwargs))
533531
else:
534-
kwargs[name] = value
532+
kwargs[name] = next(utils.for_each(source, value.split('/'), debug=debug, **kwargs))
535533
else:
536534
self.log.error(f"Variable '{name}' has an unsupported value: {value}")
537535

extensions/mizedit/MODIFY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ MyFancyPreset:
124124
variables:
125125
theatre: theatre # fills the missions theatre into the {theatre} variable
126126
temperature: weather/season/temperature # fills the mission temperature in the {temperature} variable
127+
speed: 40 # sets a fixed value for speed
127128
rand: '$random.randint(1, 10)' # fills some random number between 1 and 10 into ${rand}
128129
mylist: '$list(range(1, {rand}))' # creates a list ${mylist} of numbers starting from 1 to the result of the random pick above
129130
```

0 commit comments

Comments
 (0)