Skip to content

Commit

Permalink
feat: stop generating summon when number exceed
Browse files Browse the repository at this point in the history
  • Loading branch information
zyr17 committed Sep 7, 2023
1 parent a988df4 commit 210b6b7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions server/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -2022,6 +2022,17 @@ def _action_create_object(self, action: CreateObjectAction) \
create_result = 'RENEW',
create_idx = csnum,
)]
if (target_name == 'summon'
and len(target_list) >= self.config.max_summon_number):
# summon number reaches maximum
logging.warning(
f'player {player_idx} '
f'tried to create new {target_name} {action.object_name}, '
f'but summon number reaches maximum '
f'{self.config.max_summon_number}, and will not create '
'the summon.'
)
return []
logging.info(
f'player {player_idx} '
f'created new {target_name} {action.object_name}.'
Expand Down

0 comments on commit 210b6b7

Please sign in to comment.