Merge pull request #3055 from ApamNapat/simplified_some_boolean_logic

Simplified some booleans and if elses
This commit is contained in:
hydroflame
2022-03-10 22:11:26 -05:00
committed by GitHub
10 changed files with 14 additions and 47 deletions

View File

@@ -2004,18 +2004,13 @@ export function isQualified(this: IPlayer, company: Company, position: CompanyPo
const reqAgility = position.requiredDexterity > 0 ? position.requiredDexterity + offset : 0;
const reqCharisma = position.requiredCharisma > 0 ? position.requiredCharisma + offset : 0;
if (
this.hacking >= reqHacking &&
return this.hacking >= reqHacking &&
this.strength >= reqStrength &&
this.defense >= reqDefense &&
this.dexterity >= reqDexterity &&
this.agility >= reqAgility &&
this.charisma >= reqCharisma &&
company.playerReputation >= position.requiredReputation
) {
return true;
}
return false;
company.playerReputation >= position.requiredReputation;
}
/********** Reapplying Augmentations and Source File ***********/
@@ -2573,7 +2568,7 @@ export function queueAugmentation(this: IPlayer, name: string): void {
/************* Coding Contracts **************/
export function gainCodingContractReward(this: IPlayer, reward: ICodingContractReward, difficulty = 1): string {
if (reward == null || reward.type == null || reward == null) {
if (reward == null || reward.type == null) {
return `No reward for this contract`;
}