Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with only lowercase player name working with PvP combat (and a BountyGoal.js) #306

Merged
merged 4 commits into from
Jan 6, 2018

Conversation

bostrt
Copy link
Contributor

@bostrt bostrt commented Dec 17, 2017

No description provided.

@bostrt
Copy link
Contributor Author

bostrt commented Dec 17, 2017

I'm sorry, I did not mean to include the BountyGoal.js in this PR but it is present. If you are sensitive about the github audit trail, please let me know and I'll refile this PR.

@bostrt bostrt changed the title Fix issue with only lowercase player name working with PvP combat Fix issue with only lowercase player name working with PvP combat (and a BountyGoal.js) Dec 17, 2017
@shawncplus
Copy link
Member

Nah, it's fine. Are you still working on the bounty goal or is it done? If you're still working on it I'll wait to merge

const QuestGoal = require('../../../src/QuestGoal');

/**
* A quest goal requiring the player to locate and/or return an NPC.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is super cool even if it doesn't address the original issue ;) I think it could be a worthy contribution to the core library.

} else {
let located = false;
const goalnpcid = this.config.npc;
if (goalnpcid != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be an error if goalNpcId is null? Also, I would suggest using goalNpcId !== null for strict equality... slightly pedantic but could prevent weird bugs that might otherwise be hard to track down.

Copy link
Member

@shawncplus shawncplus Dec 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I think what I could do is making QuestGoal have a static validate() method that is called on bootup so the server won't start if you have invalid quest configurations. Like this goal could validate that it has a goal NPC. I agree about the !== as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seanohue You are correct, there's a problem if the goalnpcid is null. I'll update that with a !== null check until @shawncplus can work in a validate() method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants