Skip to content

Commit 7d82dd0

Browse files
committed
optimization
1 parent 50718f4 commit 7d82dd0

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/Savegame/Soldier.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ void Soldier::trainPsi1Day()
476476

477477
if (_currentStats.psiSkill > 0)
478478
{
479-
if (_currentStats.psiSkill < 100 && 100 * 8/_currentStats.psiSkill >= RNG::generate(1, 100))
479+
if (8 * 100 >= _currentStats.psiSkill * RNG::generate(1, 100) && _currentStats.psiSkill < 100)
480480
{
481481
++_currentStats.psiSkill;
482482
++_improvement;
@@ -487,10 +487,8 @@ void Soldier::trainPsi1Day()
487487
if (++_currentStats.psiSkill == 0) // initial training is over
488488
_currentStats.psiSkill = RNG::generate(_rules->getMinStats().psiSkill, _rules->getMaxStats().psiSkill);
489489
}
490-
else if (_currentStats.psiSkill == 0)
491-
{
492-
_currentStats.psiSkill = -RNG::generate(30, 60); // set initial training from 30 to 60 days
493-
}
490+
else // if (_currentStats.psiSkill == 0)
491+
_currentStats.psiSkill = RNG::generate(-60, -30); // set initial training from 30 to 60 days
494492
}
495493

496494
/**

0 commit comments

Comments
 (0)