Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unlocking wagons for Demonic races, slight fix for not wendigo check #1112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

saltshaker
Copy link

#1075 attempted to fix #1063 by adding a demonic-specific alt unlock for the wagon tech. This did not actually fix the problem because the not wendigo check !global.race.species === 'wendigo' is always false due to the not operator being applied to global.race.species instead of the boolean result. Switching to a strict inequality fixes this and matches the style of other inequality checks in the file.

Copy link

@Argavyon Argavyon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix is correct.

@@ -161,7 +161,7 @@ const techs = {
era: 'civilized',
reqs: { transport: 1 },
condition(){
return global.tech['farm'] || global.tech['s_lodge'] || (global.tech['hunting'] && global.tech.hunting >= 2) || (global.race['soul_eater'] && !global.race.species === 'wendigo' && global.tech.housing >= 1 && global.tech.currency >= 1) ? true : false;
return global.tech['farm'] || global.tech['s_lodge'] || (global.tech['hunting'] && global.tech.hunting >= 2) || (global.race['soul_eater'] && global.race.species !== 'wendigo' && global.tech.housing >= 1 && global.tech.currency >= 1) ? true : false;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ternary operator at the end seems unnecessary.

Suggested change
return global.tech['farm'] || global.tech['s_lodge'] || (global.tech['hunting'] && global.tech.hunting >= 2) || (global.race['soul_eater'] && global.race.species !== 'wendigo' && global.tech.housing >= 1 && global.tech.currency >= 1) ? true : false;
return global.tech['farm'] || global.tech['s_lodge'] || (global.tech['hunting'] && global.tech.hunting >= 2) || (global.race['soul_eater'] && global.race.species !== 'wendigo' && global.tech.housing >= 1 && global.tech.currency >= 1);

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm inclined to agree, though there are many other tech conditions using the ternary operator in the exact same manner. For example, the governor tech condition:
return global.genes['governor'] && global.civic.govern.type !== 'anarchy' ? true : false;
Seems odd to only clean up this instance of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Demonic races cannot research wagons in gravity well challenge
2 participants