Merge branch 'develop' into phillip/server-analytics
This commit is contained in:
@@ -320,16 +320,16 @@ api.updateHero = {
|
||||
if (plan.extraMonths || plan.extraMonths === 0) {
|
||||
hero.purchased.plan.extraMonths = plan.extraMonths;
|
||||
}
|
||||
if (plan.customerId) {
|
||||
if (plan.customerId || plan.customerId === '') {
|
||||
hero.purchased.plan.customerId = plan.customerId;
|
||||
}
|
||||
if (plan.paymentMethod) {
|
||||
if (plan.paymentMethod || plan.customerId === '') {
|
||||
hero.purchased.plan.paymentMethod = plan.paymentMethod;
|
||||
}
|
||||
if (plan.planId) {
|
||||
if (plan.planId || plan.customerId === '') {
|
||||
hero.purchased.plan.planId = plan.planId;
|
||||
}
|
||||
if (plan.owner) {
|
||||
if (plan.owner || plan.customerId === '') {
|
||||
hero.purchased.plan.owner = plan.owner;
|
||||
}
|
||||
if (plan.hourglassPromoReceived) {
|
||||
@@ -341,8 +341,7 @@ api.updateHero = {
|
||||
const group = await Group.getGroup({ user: hero, groupId: groupID });
|
||||
if (!group) throw new NotFound(res.t('groupNotFound'));
|
||||
if (group.hasNotCancelled()) {
|
||||
hero.purchased.plan.customerId = null;
|
||||
hero.purchased.plan.paymentMethod = null;
|
||||
hero.purchased.plan.paymentMethod = 'groupPlan';
|
||||
await addSubToGroupUser(hero, group);
|
||||
await group.updateGroupPlan();
|
||||
} else {
|
||||
@@ -352,34 +351,34 @@ api.updateHero = {
|
||||
}
|
||||
|
||||
if (updateData.stats) {
|
||||
if (updateData.stats.hp) {
|
||||
if (updateData.stats.hp || updateData.stats.hp === 0) {
|
||||
hero.stats.hp = updateData.stats.hp;
|
||||
}
|
||||
if (updateData.stats.mp) {
|
||||
if (updateData.stats.mp || updateData.stats.mp === 0) {
|
||||
hero.stats.mp = updateData.stats.mp;
|
||||
}
|
||||
if (updateData.stats.exp) {
|
||||
if (updateData.stats.exp || updateData.stats.exp === 0) {
|
||||
hero.stats.exp = updateData.stats.exp;
|
||||
}
|
||||
if (updateData.stats.gp) {
|
||||
if (updateData.stats.gp || updateData.stats.gp === 0) {
|
||||
hero.stats.gp = updateData.stats.gp;
|
||||
}
|
||||
if (updateData.stats.lvl) {
|
||||
if (updateData.stats.lvl || updateData.stats.lvl === 0) {
|
||||
hero.stats.lvl = updateData.stats.lvl;
|
||||
}
|
||||
if (updateData.stats.points) {
|
||||
if (updateData.stats.points || updateData.stats.points === 0) {
|
||||
hero.stats.points = updateData.stats.points;
|
||||
}
|
||||
if (updateData.stats.str) {
|
||||
if (updateData.stats.str || updateData.stats.str === 0) {
|
||||
hero.stats.str = updateData.stats.str;
|
||||
}
|
||||
if (updateData.stats.int) {
|
||||
if (updateData.stats.int || updateData.stats.int === 0) {
|
||||
hero.stats.int = updateData.stats.int;
|
||||
}
|
||||
if (updateData.stats.per) {
|
||||
if (updateData.stats.per || updateData.stats.per === 0) {
|
||||
hero.stats.per = updateData.stats.per;
|
||||
}
|
||||
if (updateData.stats.con) {
|
||||
if (updateData.stats.con || updateData.stats.con === 0) {
|
||||
hero.stats.con = updateData.stats.con;
|
||||
}
|
||||
if (updateData.stats.buffs) {
|
||||
|
||||
Reference in New Issue
Block a user