111 |
} |
} |
112 |
} |
} |
113 |
|
|
114 |
void |
bool |
115 |
options::SetLevelTime(const string &pack, const string &level, int difficulty, int time) |
options::SetLevelTime(const string &pack, const string &level, int difficulty, int time) |
116 |
{ |
{ |
117 |
SetLevelFinished(pack, level, difficulty); |
SetLevelFinished(pack, level, difficulty); |
119 |
|
|
120 |
assert(stat); |
assert(stat); |
121 |
|
|
122 |
|
bool new_record = false; |
123 |
|
|
124 |
if (difficulty == enigma::DIFFICULTY_EASY) { |
if (difficulty == enigma::DIFFICULTY_EASY) { |
125 |
if (stat->par_easy > time || stat->par_easy == -1) { |
if (stat->par_easy > time || stat->par_easy == -1) { |
126 |
stat->par_easy = time; |
stat->par_easy = time; |
127 |
LevelStatusChanged = true; |
LevelStatusChanged = true; |
128 |
|
new_record = true; |
129 |
} |
} |
130 |
} |
} |
131 |
else if (difficulty == enigma::DIFFICULTY_HARD) { |
else if (difficulty == enigma::DIFFICULTY_HARD) { |
132 |
if (stat->par_hard > time || stat->par_hard == -1) { |
if (stat->par_hard > time || stat->par_hard == -1) { |
133 |
stat->par_hard = time; |
stat->par_hard = time; |
134 |
LevelStatusChanged = true; |
LevelStatusChanged = true; |
135 |
|
new_record = true; |
136 |
} |
} |
137 |
} |
} |
138 |
|
return new_record; |
139 |
} |
} |
140 |
|
|
141 |
void |
void |