Skip to content

Commit 5b00889

Browse files
authored
Merge pull request #7336 from IllianiBird/noArtillery
Fix: Stopped Personnel From Entering Play with Artillery Skills if Artillery is Disabled
2 parents 92658a8 + eb21bba commit 5b00889

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

MekHQ/src/mekhq/campaign/personnel/generator/DefaultSkillGenerator.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,19 @@ public void generateSkills(final Campaign campaign, final Person person, final i
137137

138138
// roll random secondary skill
139139
if (Utilities.rollProbability(skillPreferences.getSecondSkillProb())) {
140+
boolean isUseArtillery = campaignOptions.isUseArtillery();
140141
List<String> possibleSkills = new ArrayList<>();
141142
for (String skillType : SkillType.skillList) {
142143
SkillType type = SkillType.getType(skillType);
143-
if (!person.getSkills().hasSkill(skillType) && !DEPRECATED_SKILLS.contains(type)
144+
if (!person.getSkills().hasSkill(skillType)
145+
&& !DEPRECATED_SKILLS.contains(type)
144146
// The next two are to prevent double-dipping
145-
&& !type.isSubTypeOf(SUPPORT_COMMAND) && !type.isRoleplaySkill()) {
147+
&& !type.isSubTypeOf(SUPPORT_COMMAND)
148+
&& !type.isRoleplaySkill()) {
149+
if (SkillType.S_ARTILLERY.equals(type.getName()) && !isUseArtillery) {
150+
continue;
151+
}
152+
146153
possibleSkills.add(skillType);
147154
}
148155
}

0 commit comments

Comments
 (0)