Browse Source

fixes #44

tags/v0.1.8^2
Big Bad Waffle 6 years ago
parent
commit
690b63c0c6
3 changed files with 24 additions and 9 deletions
  1. +10
    -7
      src/client/js/components/reputation.js
  2. +12
    -1
      src/server/components/extensions/socialCommands.js
  3. +2
    -1
      src/server/components/reputation.js

+ 10
- 7
src/client/js/components/reputation.js View File

@@ -1,6 +1,6 @@
define([
'js/system/events'
], function(
], function (
events
) {
return {
@@ -9,18 +9,21 @@ define([
list: [],
factions: [],

init: function() {
init: function () {
events.emit('onGetReputations', this.list);
},

extend: function(blueprint) {
extend: function (blueprint) {
if (blueprint.modifyRep) {
blueprint.modifyRep.forEach(function(m) {
blueprint.modifyRep.forEach(function (m) {
var exists = this.list.find(l => (l.id == m.id));
if (!exists)
this.list.push(m);
else
exists.rep = m.rep;
else {
for (var p in m) {
exists[p] = m[p];
}
}
}, this);

delete blueprint.modifyRep;
@@ -29,4 +32,4 @@ define([
}
}
};
});
});

+ 12
- 1
src/server/components/extensions/socialCommands.js View File

@@ -24,7 +24,8 @@ define([
godMode: 10,
clearInventory: 10,
completeQuests: 10,
getReputation: 10
getReputation: 10,
loseReputation: 10
};

var localCommands = [
@@ -319,7 +320,17 @@ define([
},

getReputation: function (faction) {
if (typeof (faction) != 'string')
return;

this.obj.reputation.getReputation(faction, 50000);
},

loseReputation: function (faction) {
if (typeof (faction) != 'string')
return;

this.obj.reputation.getReputation(faction, -50000);
}
};
});

+ 2
- 1
src/server/components/reputation.js View File

@@ -205,7 +205,8 @@ define([
var l = this.list.find(l => (l.id == factionId));
var faction = {
id: factionId,
rep: l.rep
rep: l.rep,
tier: l.tier
};

if (full) {


Loading…
Cancel
Save