@@ -65,7 +65,7 @@ GET_ATTRIB_STAT_FN(throwing)
6565GET_ATTRIB_STAT_FN (strength)
6666int psiStrengthStat (Game *game, Soldier *s)
6767{
68- // don't reveal psi strength before it would otherwise be known
68+ // don't reveal (relative) psi strength before it would otherwise be known
6969 if (s->getCurrentStats ()->psiSkill > 0
7070 || (Options::psiStrengthEval
7171 && game->getSavedGame ()->isResearched (game->getMod ()->getPsiRequirements ())))
@@ -162,8 +162,28 @@ CraftSoldiersState::CraftSoldiersState(Base *base, size_t craft)
162162 PUSH_IN (" STR_FIRING_ACCURACY" , firingStat);
163163 PUSH_IN (" STR_THROWING_ACCURACY" , throwingStat);
164164 PUSH_IN (" STR_STRENGTH" , strengthStat);
165- PUSH_IN (" STR_PSIONIC_STRENGTH" , psiStrengthStat);
166- PUSH_IN (" STR_PSIONIC_SKILL" , psiSkillStat);
165+
166+ // don't show psionic sort options until they actually have data they can use
167+ bool showPsiStrength = Options::psiStrengthEval
168+ && _game->getSavedGame ()->isResearched (_game->getMod ()->getPsiRequirements ());
169+ bool showPsiSkill = false ;
170+ for (std::vector<Soldier*>::iterator i = _base->getSoldiers ()->begin (); i != _base->getSoldiers ()->end (); ++i)
171+ {
172+ if (showPsiSkill) { break ; }
173+ if ((*i)->getCurrentStats ()->psiSkill > 0 )
174+ {
175+ showPsiSkill = true ;
176+ }
177+ }
178+ if (showPsiStrength)
179+ {
180+ PUSH_IN (" STR_PSIONIC_STRENGTH" , psiStrengthStat);
181+ }
182+ if (showPsiSkill)
183+ {
184+ PUSH_IN (" STR_PSIONIC_SKILL" , psiSkillStat);
185+ }
186+
167187 PUSH_IN (" STR_MELEE_ACCURACY" , meleeStat);
168188
169189#undef PUSH_IN
@@ -287,7 +307,6 @@ void CraftSoldiersState::init()
287307{
288308 State::init ();
289309 initList ();
290-
291310}
292311
293312/* *
0 commit comments