Conversation
| public boolean prerequisiteMet(Player player) { | ||
| return mPrerequisites == null || mPrerequisites.prerequisiteMet(new QuestContext(Plugin.getInstance(), player, null)); | ||
| return (mPrerequisites == null || mPrerequisites.prerequisiteMet(new QuestContext(Plugin.getInstance(), player, null))) | ||
| && player.getWorld().getName().matches(mWorldRegex); |
There was a problem hiding this comment.
I set up something for zones that checks if world names match regex from a list as they load so that they don't need to be checked more than once; regex checks are slow.
Signed-off-by: Byron Marohn <Combustible@live.com>
| return false; | ||
| } | ||
| WorldRegexMatcher matcher = QuestCompassManager.getInstance().getWorldRegexMatcher(); | ||
| if (matcher != null && matcher.isKnownRegex(mWorldRegex)) { |
There was a problem hiding this comment.
In theory isKnownRegex shouldn't be required, so this fallback should never be used. Not a bad idea to keep it, but might be worth logging when this happens so we can look into it.
There was a problem hiding this comment.
I agree this shouldn't be required, but I couldn't convince myself that it definitely wasn't. Hence the comment on the next line - I didn't want to fall into the matcher if somehow this got tested against an object that wasn't registered. Right now the matcher logic for the variant that takes a world directly just returns false if the regex wasn't registered, rather than falling back to trying to look it up directly. Not sure if I should just change that... or this weird guard that does a 2nd lookup... hmmm...
NickNackGus
left a comment
There was a problem hiding this comment.
My only remaining concern is if the QuestLocation interface's other implementation needs to be handled as well.
|
The other implementer is DeathLocation - it doesn't have a prereq check though... I think if we wanted to expand that it'd be a separate PR, since we'd have to add prereq usage there to filter out deaths on the wrong world. I think we may need to do that later when we have multi-world-dungeon-host support, but today I can't think of a way this would happen |
Signed-off-by: Byron Marohn <Combustible@live.com>
Uh oh!
There was an error while loading. Please reload this page.