Skip to content

Commit

Permalink
Merge pull request #1146 from MegaMek/tech_intro_date_fix
Browse files Browse the repository at this point in the history
Mixed tech intro date check
  • Loading branch information
neoancient authored Sep 17, 2018
2 parents b851dd5 + a5701f4 commit 96bc212
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions megamek/src/megamek/common/ITechManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,17 @@ && unofficialNoYear()) {
int faction = getTechFaction();
boolean clanTech = useClanTechBase();

boolean introducedIS = tech.getIntroductionDate(false) <= getTechIntroYear();
boolean introducedClan = tech.getIntroductionDate(true) <= getTechIntroYear();
int isIntroDate = tech.getIntroductionDate(false);
int clanIntroDate = tech.getIntroductionDate(true);
boolean introducedIS = (isIntroDate != ITechnology.DATE_NONE) && (isIntroDate <= getTechIntroYear());
boolean introducedClan = (clanIntroDate != ITechnology.DATE_NONE) && (clanIntroDate <= getTechIntroYear());
boolean extinctIS = tech.isExtinct(getTechIntroYear(), false);
boolean extinctClan = tech.isExtinct(getTechIntroYear(), true);
// A little bit of hard-coded universe detail
if ((faction == ITechnology.F_CS)
&& extinctIS && (tech.getReintroductionDate(false) != ITechnology.DATE_NONE)
&& extinctIS && (isIntroDate != ITechnology.DATE_NONE)
&& (tech.getBaseAvailability(ITechnology.getTechEra(getTechIntroYear())) < ITechnology.RATING_X)
&& tech.getIntroductionDate(false) <= getTechIntroYear()) {
&& isIntroDate <= getTechIntroYear()) {
// ComStar has access to Star League tech that is otherwise extinct in the Inner Sphere as if TH,
// unless it has an availability of X (which is SLDF Royal equipment).
extinctIS = false;
Expand Down

0 comments on commit 96bc212

Please sign in to comment.