Don't calculate experience gained if the Pokemon is not allowed to receive experience.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
92135a88eb
commit
d6792635f9
|
@ -14,6 +14,8 @@ void PkmnLib::Battling::ExperienceLibrary::HandleExperienceGain(
|
|||
auto v1 = (expGain * level) / 5;
|
||||
|
||||
for (auto op : opponents) {
|
||||
if (!op->AllowedExperienceGain())
|
||||
continue;
|
||||
auto v2 = pow(2 * level + 10, 2.5) / pow(level + op->GetLevel() + 10, 2.5);
|
||||
uint32_t experienceGain = v1 * v2 + 1;
|
||||
// TODO: Check owner and international
|
||||
|
|
Loading…
Reference in New Issue