Skip to content

Commit

Permalink
Improve relationship save robustness
Browse files Browse the repository at this point in the history
favour the higher relationship when comparing the 2 characters
  • Loading branch information
KiloOscarSix committed May 8, 2024
1 parent c998c77 commit e13d60a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CharacterService_ren.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ def get_relationship(
if not hasattr(character, "relationships"):
character.relationships = {}

if (
target.relationships.get(character, Relationship.STRANGER).value
> character.relationships.get(target, Relationship.STRANGER).value
):
character.relationships[target] = target.relationships[character]

return character.relationships.setdefault(target, Relationship.FRIEND)

@staticmethod
Expand Down

0 comments on commit e13d60a

Please sign in to comment.