mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-04-15 12:07:43 +00:00
Misc. bug fixes from lgtm.com (#9325)
* Bugfix: declare variable locally * Bugfix: fix syntax error * Bugfix: regex char-class with alternatives The old implementation used character classes instead of alternatives. As a consequence, the regex would match: - a_warrior_0 - r_warrior_0 - m_warrior_0 - o_warrior_0 - r_warrior_0 - |_warrior_0 - h_warrior_0 - ... The regex will now match: - armor_warrior_0 - head_warrior_0 - shield_warrior_0
This commit is contained in:
parent
885f2998ae
commit
f62177fb1a
3 changed files with 5 additions and 5 deletions
|
|
@ -16,7 +16,7 @@ var migrationName = '20140831_increase_gems_for_previous_contributions';
|
|||
* https://github.com/HabitRPG/habitrpg/issues/3933
|
||||
* Increase Number of Gems for Contributors
|
||||
* author: Alys (d904bd62-da08-416b-a816-ba797c9ee265)
|
||||
*
|
||||
*
|
||||
* Increase everyone's gems per their contribution level.
|
||||
* Originally they were given 2 gems per tier.
|
||||
* Now they are given 3 gems per tier for tiers 1,2,3
|
||||
|
|
@ -70,7 +70,7 @@ dbUsers.findEach(query, fields, function(err, user) {
|
|||
var extraGems = tier; // tiers 1,2,3
|
||||
if (tier > 3) { extraGems = 3 + (tier - 3) * 2; }
|
||||
if (tier == 8) { extraGems = 11; }
|
||||
extraBalance = extraGems / 4;
|
||||
var extraBalance = extraGems / 4;
|
||||
set['balance'] = user.balance + extraBalance;
|
||||
|
||||
// Capture current state of user:
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ function findUsers(gt){
|
|||
console.log('User: ', countUsers, user._id);
|
||||
|
||||
var update = {
|
||||
$set: {};
|
||||
$set: {}
|
||||
};
|
||||
|
||||
if(user.auth && user.auth.local) {
|
||||
|
|
@ -60,4 +60,4 @@ function findUsers(gt){
|
|||
});
|
||||
};
|
||||
|
||||
findUsers();
|
||||
findUsers();
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ let schema = new Schema({
|
|||
gear: {
|
||||
owned: _.transform(shared.content.gear.flat, (m, v) => {
|
||||
m[v.key] = {type: Boolean};
|
||||
if (v.key.match(/[armor|head|shield]_warrior_0/) || v.gearSet === 'glasses') {
|
||||
if (v.key.match(/(armor|head|shield)_warrior_0/) || v.gearSet === 'glasses') {
|
||||
m[v.key].default = true;
|
||||
}
|
||||
}),
|
||||
|
|
|
|||
Loading…
Reference in a new issue