remove produce_exp caching in static variables (more slowdown)

This commit is contained in:
Enno Rehling 2015-11-22 10:21:37 +01:00
parent 6b83120c7a
commit 66dd1b8172
2 changed files with 1 additions and 7 deletions

View File

@ -259,7 +259,6 @@ extern "C" {
/* the following are some cached values, because get_param can be slow.
* you should almost never need to touch them */
int cookie;
double producexpchance_;
} settings;
typedef struct helpmode {

View File

@ -1931,12 +1931,7 @@ bool unit_can_study(const unit *u) {
}
static double produceexp_chance(void) {
static int update = 0;
if (update != global.cookie) {
global.producexpchance_ = get_param_flt(global.parameters, "study.from_use", 1.0 / 3);
update = global.cookie;
}
return global.producexpchance_;
return get_param_flt(global.parameters, "study.from_use", 1.0 / 3);
}
void produceexp_ex(struct unit *u, skill_t sk, int n, bool (*learn)(unit *, skill_t, double))