mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-18 12:02:54 +00:00
fix(quests): prevent very high damage
This commit is contained in:
parent
860b3acc52
commit
89369e21a3
2 changed files with 7 additions and 4 deletions
|
|
@ -237,10 +237,6 @@ process.nextTick(function(){
|
|||
GroupSchema.statics.tavernBoss = function(user,progress) {
|
||||
if (!progress) return;
|
||||
|
||||
// hack: prevent crazy damage to world boss
|
||||
progress.up = Math.min(300, Math.abs(progress.up||0));
|
||||
progress.down = -Math.min(300, Math.abs(progress.down||0));
|
||||
|
||||
async.waterfall([
|
||||
function(cb){
|
||||
mongoose.model('Group').findOne(tavernQ,cb);
|
||||
|
|
|
|||
|
|
@ -403,6 +403,13 @@ UserSchema.pre('save', function(next) {
|
|||
|
||||
this.achievements.beastMaster = petCount >= 90;
|
||||
|
||||
var progress = this.party && this.party.quest && this.party.quest.progress;
|
||||
if (progress) {
|
||||
// hack: prevent crazy damage to bosses (see https://github.com/HabitRPG/habitrpg/issues/3712)
|
||||
progress.up = Math.min(300, Math.abs(progress.up||0));
|
||||
progress.down = -Math.min(300, Math.abs(progress.down||0));
|
||||
}
|
||||
|
||||
//our own version incrementer
|
||||
this._v++;
|
||||
next();
|
||||
|
|
|
|||
Loading…
Reference in a new issue