Skip to content

Commit

Permalink
Add flag override in the loader.
Browse files Browse the repository at this point in the history
  • Loading branch information
kw committed Apr 18, 2024
1 parent c1f4e82 commit 99cdf3e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/camp/engine/rules/base_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,10 @@ def new_character(self, **data) -> CharacterController:
)

def load_character(
self, data: dict, metadata: base_models.CharacterMetadata | None = None
self,
data: dict,
metadata: base_models.CharacterMetadata | None = None,
flags: dict[str, Any] | None = None,
) -> CharacterController:
"""Load the given character data with this ruleset.
Expand All @@ -1268,6 +1271,8 @@ def load_character(
model = self.sheet_type(**updated_data)
if metadata:
model.metadata = metadata
if flags:
model.metadata.flags.update(flags)
c = self.character_controller(self, model)
c.reconcile()
return c
Expand Down

0 comments on commit 99cdf3e

Please sign in to comment.