Support for blocking a creature from gaining experience, don't give experience when a creature is fainted.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -6,6 +6,10 @@ void CreatureLib::Battling::ExperienceLibrary::HandleExperienceGain(
|
||||
for (auto opponent : opponents) {
|
||||
if (opponent == nullptr)
|
||||
continue;
|
||||
if (opponent->IsFainted())
|
||||
continue;
|
||||
if (!opponent->AllowedExperienceGain())
|
||||
continue;
|
||||
auto levelDiff = faintedMon->GetLevel() - opponent->GetLevel() + 10;
|
||||
if (levelDiff <= 0)
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user