mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
attempt fix using _.each in place of for loops
This commit is contained in:
@@ -290,16 +290,16 @@ ready(function(model) {
|
||||
return model.set('_items.weapon', content.items.weapon[1]);
|
||||
};
|
||||
exports.poormanscron = poormanscron = function() {
|
||||
var daysPassed, lastCron, n, today, _k;
|
||||
var daysPassed, lastCron, today;
|
||||
today = new Date();
|
||||
model.setNull('_user.lastCron', today);
|
||||
lastCron = model.get('_user.lastCron');
|
||||
daysPassed = helpers.daysBetween(lastCron, today);
|
||||
if (daysPassed > 0) {
|
||||
for (n = _k = 1; 1 <= daysPassed ? _k <= daysPassed : _k >= daysPassed; n = 1 <= daysPassed ? ++_k : --_k) {
|
||||
scoring.tally(model);
|
||||
}
|
||||
return model.set('_user.lastCron', today);
|
||||
model.set('_user.lastCron', today);
|
||||
return _.times(daysPassed, (function() {
|
||||
return scoring.tally(model);
|
||||
}));
|
||||
}
|
||||
};
|
||||
setTimeout((function() {
|
||||
|
||||
Reference in New Issue
Block a user