Skip to content

Commit

Permalink
Fix trigger system not working if the GM is not present in area but i…
Browse files Browse the repository at this point in the history
…s present for hub
  • Loading branch information
Crystalwarrior committed Oct 29, 2024
1 parent e9d1713 commit 61d5408
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
10 changes: 2 additions & 8 deletions server/area.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,8 @@ def trigger(self, trig, target):
return

# Sort through all the owners, with GMs coming first and CMs coming second
sorted_owners = sorted(
self.owners,
key=lambda x: 0
if (x in self.area_manager.owners)
else 1
if (x in self._owners)
else 2,
)
sorted_owners = list(self._owners) + list(self.area_manager.owners)

# Pick the owner with highest permission - game master, if one exists.
# This permission system may be out of wack, but it *should* be good for now
owner = sorted_owners[0]
Expand Down
10 changes: 2 additions & 8 deletions server/evidence.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,8 @@ def trigger(self, area, trig, target):
return

# Sort through all the owners, with GMs coming first and CMs coming second
sorted_owners = sorted(
area.owners,
key=lambda x: 0
if (x in area.area_manager.owners)
else 1
if (x in area._owners)
else 2,
)
sorted_owners = list(area._owners) + list(area.area_manager.owners)

# Pick the owner with highest permission - game master, if one exists.
# This permission system may be out of wack, but it *should* be good for now
owner = sorted_owners[0]
Expand Down

0 comments on commit 61d5408

Please sign in to comment.