Don't check for recurrent waves on join.

This commit removes a condition in ArenaImpl#canJoin(Player) that checks to see if the arena's WaveManager has any recurrent waves.

Removing this condition is safe, because the WaveManager already makes sure to have a "catch all" default wave at hand for when no wave definitions match a given wave number. As such, the condition in ArenaImpl is completely unnecessary, and was in fact the root cause of a bug.

Fixes #566
This commit is contained in:
Andreas Troelsen 2019-08-16 00:46:01 +02:00
parent 677ae6c454
commit a59a4f911d
2 changed files with 2 additions and 1 deletions

View File

@ -11,6 +11,7 @@ These changes will (most likely) be included in the next version.
## [Unreleased] ## [Unreleased]
- It is no longer necessary to have recurrent waves for an arena to work. MobArena automatically creates a "catch all" recurrent wave in case the arena session reaches a wave number that isn't covered by any other wave definitions.
## [0.104] - 2019-08-08 ## [0.104] - 2019-08-08
- Extended and upgraded potions are now supported in the item syntax by prepending `long_` or `strong_` to the data portion of a potion item (e.g. `potion:strong_instant_heal:1` will yield a Potion of Healing II). Check the wiki for details. - Extended and upgraded potions are now supported in the item syntax by prepending `long_` or `strong_` to the data portion of a potion item (e.g. `potion:strong_instant_heal:1` will yield a Potion of Healing II). Check the wiki for details.

View File

@ -1507,7 +1507,7 @@ public class ArenaImpl implements Arena
public boolean canJoin(Player p) { public boolean canJoin(Player p) {
if (!enabled) if (!enabled)
messenger.tell(p, Msg.JOIN_ARENA_NOT_ENABLED); messenger.tell(p, Msg.JOIN_ARENA_NOT_ENABLED);
else if (!region.isSetup() || waveManager.getRecurrentWaves().isEmpty()) else if (!region.isSetup())
messenger.tell(p, Msg.JOIN_ARENA_NOT_SETUP); messenger.tell(p, Msg.JOIN_ARENA_NOT_SETUP);
else if (edit) else if (edit)
messenger.tell(p, Msg.JOIN_ARENA_EDIT_MODE); messenger.tell(p, Msg.JOIN_ARENA_EDIT_MODE);