[-] Fixed incorrect update for Kill and XP variables when upgrading-to
This commit is contained in:
parent
b21dc46d49
commit
80ad72bcd4
1 changed files with 7 additions and 3 deletions
|
@ -128,9 +128,13 @@ static int TransformUnitIntoType(CUnit &unit, const CUnitType &newtype)
|
|||
} else {
|
||||
unit.Variable[i].Value = newstats.Variables[i].Value;
|
||||
}
|
||||
unit.Variable[i].Max = newstats.Variables[i].Max;
|
||||
unit.Variable[i].Increase = newstats.Variables[i].Increase;
|
||||
unit.Variable[i].Enable = newstats.Variables[i].Enable;
|
||||
if (i == KILL_INDEX || i == XP_INDEX) {
|
||||
unit.Variable[i].Value = unit.Variable[i].Max;
|
||||
} else {
|
||||
unit.Variable[i].Max = newstats.Variables[i].Max;
|
||||
unit.Variable[i].Increase = newstats.Variables[i].Increase;
|
||||
unit.Variable[i].Enable = newstats.Variables[i].Enable;
|
||||
}
|
||||
}
|
||||
|
||||
unit.Type = const_cast<CUnitType *>(&newtype);
|
||||
|
|
Loading…
Reference in a new issue