forked from github/server
"Temp-Einheiten erben Lernschwelle nicht"
This commit is contained in:
parent
c54e3f3be5
commit
b83ae9fb58
1 changed files with 31 additions and 24 deletions
|
@ -929,13 +929,19 @@ transfermen(unit * u, unit * u2, int n)
|
|||
assert(u2->number+n>0);
|
||||
|
||||
for (sk=0; sk!=MAXSKILLS; ++sk) {
|
||||
double dlevel = 0.0;
|
||||
int weeks, level = 0;
|
||||
|
||||
sv = get_skill(u, sk);
|
||||
sn = get_skill(u2, sk);
|
||||
|
||||
if (sv==NULL && sn==NULL) continue;
|
||||
if (sn==NULL && u2->number==0) {
|
||||
/* new unit, easy to solve */
|
||||
level = sv->level;
|
||||
weeks = sv->weeks;
|
||||
} else {
|
||||
double dlevel = 0.0;
|
||||
|
||||
if (sv && sv->level) {
|
||||
dlevel += (sv->level + 1 - sv->weeks/(sv->level+1.0)) * n;
|
||||
level += sv->level * n;
|
||||
|
@ -961,6 +967,7 @@ transfermen(unit * u, unit * u2, int n)
|
|||
level = (int)dlevel+1;
|
||||
weeks = 1 + 2 * level - (int)((1 + dlevel - level) * level);
|
||||
}
|
||||
}
|
||||
if (level) {
|
||||
if (sn==NULL) sn = add_skill(u2, sk);
|
||||
sn->level = (unsigned char)level;
|
||||
|
|
Loading…
Reference in a new issue