mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
prevent Quest progress message in Party chat when user is Resting in the Inn (#10636)
* prevent quest progress message in party chat when user is resting in the inn * improve comment * update tests now that the test group includes a new member (sleeping quest participant) * adjust a test to fix lint failure (and make the test better) * fix order of element assignments in test array
This commit is contained in:
@@ -1091,6 +1091,8 @@ schema.methods._processCollectionQuest = async function processCollectionQuest (
|
||||
};
|
||||
|
||||
schema.statics.processQuestProgress = async function processQuestProgress (user, progress) {
|
||||
if (user.preferences.sleep) return;
|
||||
|
||||
let group = await this.getGroup({user, groupId: 'party'});
|
||||
|
||||
if (!_isOnQuest(user, progress, group)) return;
|
||||
@@ -1101,7 +1103,7 @@ schema.statics.processQuestProgress = async function processQuestProgress (user,
|
||||
|
||||
let questType = quest.boss ? 'Boss' : 'Collection';
|
||||
|
||||
await group[`_process${questType}Quest`]({
|
||||
await group[`_process${questType}Quest`]({ // _processBossQuest, _processCollectionQuest
|
||||
user,
|
||||
progress,
|
||||
group,
|
||||
@@ -1131,6 +1133,7 @@ process.nextTick(() => {
|
||||
// returns a promise
|
||||
schema.statics.tavernBoss = async function tavernBoss (user, progress) {
|
||||
if (!progress) return;
|
||||
if (user.preferences.sleep) return;
|
||||
|
||||
// hack: prevent crazy damage to world boss
|
||||
let dmg = Math.min(900, Math.abs(progress.up || 0));
|
||||
|
||||
Reference in New Issue
Block a user