Skip to content
Snippets Groups Projects
Commit bebe6bb2 authored by svornost's avatar svornost
Browse files

cleanup for opinion function

parent 02501c42
No related branches found
No related tags found
No related merge requests found
......@@ -6,13 +6,10 @@
App.Neighbor.opinion = function(activeID, targetID) {
const activeArcology = V.arcologies[activeID];
const targetArcology = V.arcologies[targetID];
if (typeof activeArcology.FSNull === "undefined") { activeArcology.FSNull = "unset"; }
if (typeof targetArcology.FSNull === "undefined") { targetArcology.FSNull = "unset"; }
const {shared, conflicting} = FutureSocieties.diplomaticFSes(activeID, targetID);
let opinion = 0;
const {shared, conflicting} = FutureSocieties.diplomaticFSes(activeID, targetID);
for (const fs of shared) {
opinion += activeArcology[fs];
opinion += targetArcology[fs];
......@@ -32,7 +29,7 @@ App.Neighbor.opinion = function(activeID, targetID) {
}
}
return opinion = Number(opinion) || 0;
return opinion;
};
/** set a new influence target for a given arcology
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment