Commit 4dca2ea0 authored by Big Bad Waffle's avatar Big Bad Waffle

fixed another rethink serialization issue

parent 5b256525
......@@ -100,22 +100,27 @@ module.exports = {
}
let reputation = this.obj.reputation;
if (result.factions && reputation) {
if (result.factions) {
result.factions = result.factions.map(function (f) {
let faction = reputation.getBlueprint(f.id);
let factionTier = reputation.getTier(f.id);
let noEquip = null;
if (factionTier < f.tier)
noEquip = true;
return {
let res = {
id: f.id,
name: faction.name,
tier: f.tier,
tierName: ['Hated', 'Hostile', 'Unfriendly', 'Neutral', 'Friendly', 'Honored', 'Revered', 'Exalted'][f.tier],
noEquip: noEquip
tierName: ['Hated', 'Hostile', 'Unfriendly', 'Neutral', 'Friendly', 'Honored', 'Revered', 'Exalted'][f.tier]
};
if (reputation) {
let faction = reputation.getBlueprint(f.id);
let factionTier = reputation.getTier(f.id);
let noEquip = null;
if (factionTier < f.tier)
noEquip = true;
res.name = faction.name;
res.noEquip = noEquip;
}
return res;
}, this);
}
......
const cpnInventory = require('./inventory');
module.exports = {
type: 'stash',
......@@ -162,6 +164,6 @@ module.exports = {
},
serialize: function () {
return this.items;
return this.items.map(i => cpnInventory.simplifyItem.call({ obj: {} }, i));
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment