MultiServer:

implement a hint recheck that triggers on get_save()
Still torn if I want a single hint list per team and filter on demand, or have filtered lists and re_check on demand.
This commit is contained in:
Fabian Dill 2021-06-25 21:04:37 +02:00
parent 007f66d86e
commit f870bb3fad
2 changed files with 9 additions and 1 deletions

View File

@ -244,7 +244,15 @@ class Context(Node):
import atexit
atexit.register(self._save, True) # make sure we save on exit too
def recheck_hints(self):
for team, slot in self.hints:
self.hints[team, slot] = {
hint.re_check(self, team) for hint in
self.hints[team, slot]
}
def get_save(self) -> dict:
self.recheck_hints()
d = {
"connect_names": self.connect_names,
"received_items": self.received_items,

View File

@ -550,7 +550,7 @@ def roll_settings(weights: dict, plando_options: typing.Set[str] = frozenset(("b
roll_alttp_settings(ret, game_weights, plando_options)
elif ret.game == "Hollow Knight":
for option_name, option in Options.hollow_knight_options.items():
setattr(ret, option_name, option.from_any(get_choice(option_name, game_weights, True)))
setattr(ret, option_name, option.from_any(get_choice(option_name, game_weights)))
elif ret.game == "Factorio":
for option_name, option in Options.factorio_options.items():
if option_name in game_weights: