Improved error handling for Faction Banning mechanism

This commit is contained in:
danielyxie 2018-11-30 04:19:51 -08:00
parent 4db697fd8e
commit 34af01efdc
4 changed files with 5 additions and 5 deletions

File diff suppressed because one or more lines are too long

@ -155,7 +155,9 @@ function joinFaction(faction) {
//Determine what factions you are banned from now that you have joined this faction
for(const i in factionInfo.enemies) {
const enemy = factionInfo.enemies[i];
Factions[enemy].isBanned = true;
if (Factions[enemy] instanceof Faction) {
Factions[enemy].isBanned = true;
}
}
}

@ -589,8 +589,6 @@ PlayerObject.prototype.gainIntelligenceExp = function(exp) {
}
if (hasAISF || this.intelligence > 0) {
this.intelligence_exp += exp;
} else {
console.log("Not gaining intelligence experience bc it hasn't been unlocked yet");
}
}

@ -40,7 +40,7 @@ function factionInvitationBoxCreate(faction) {
//Remove from invited factions
var i = Player.factionInvitations.findIndex((facName)=>{return facName === faction.name});
if (i === -1) {
console.log("ERROR: Could not find faction in Player.factionInvitations");
console.error("Could not find faction in Player.factionInvitations");
} else {
Player.factionInvitations.splice(i, 1);
}