Skip to content

Commit

Permalink
Fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
indjev99 committed Jan 26, 2022
1 parent 2388c3e commit 09d22e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion max.model

This file was deleted.

8 changes: 4 additions & 4 deletions src/Despirala-Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ void simRegMove(State& s, Occurs& occurs, int extraDice, int reward, Config& con
{
if (!instaDone && s.goods > 0) rolls = chooseNumRolls(config);

won = rolls >= 0 && rolls <= s.goods;
won = instaDone || (rolls > 0 && rolls <= s.goods);
if (!won) rolls = s.goods;
}
else
Expand All @@ -1012,9 +1012,6 @@ void simRegMove(State& s, Occurs& occurs, int extraDice, int reward, Config& con
won = isDone(occurs);
}

s.goods -= rolls;
if (won) s.score += reward;

if (!instaDone && s.goods > 0 && config.logMode == LOG_WRITE) config.logOut << (won ? rolls : -1) << std::endl;

if (!config.manualRolls && config.verbose)
Expand All @@ -1023,6 +1020,9 @@ void simRegMove(State& s, Occurs& occurs, int extraDice, int reward, Config& con
else std::cout << "Didn't complete the combination." << std::endl;
}

s.goods -= rolls;
if (won) s.score += reward;

s.updateExpScore(getScore(s.free, s.goods), instaDone ? R_NONE : R_LUCK, config.evalLM);

if (won && config.verbose)
Expand Down

0 comments on commit 09d22e6

Please sign in to comment.