Skip to content

Commit

Permalink
src: Fix cropping loading/saving
Browse files Browse the repository at this point in the history
  • Loading branch information
Vicki Pfau committed Aug 31, 2018
1 parent 41670e4 commit c1b95a9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ bool Scenario::save(ostream* file) const {

CropInfo firstCrop = m_crops[0];
unsigned nCrops = 1;
for (unsigned i = MAX_PLAYERS - 1; i > 0; ++i) {
for (unsigned i = MAX_PLAYERS - 1; i > 0; --i) {
if (m_crops[i] != firstCrop && m_crops[i] != CropInfo{}) {
nCrops = i + 1;
break;
Expand Down Expand Up @@ -777,6 +777,7 @@ void Scenario::reset() {
for (int i = 0; i < MAX_PLAYERS; ++i) {
m_rewardVars[i].clear();
m_rewardTime[i] = { Measurement::DELTA };
m_crops[i] = {};
}
m_doneVars.clear();
m_doneCondition = DoneCondition::ANY;
Expand Down

0 comments on commit c1b95a9

Please sign in to comment.