When cloning a battle, ensure the old battle data is always cleared from the cloned party.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
44ffadb439
commit
44c47d64bd
|
@ -17,7 +17,13 @@ void PkmnLib::Battling::Battle::ClearWeather() {
|
|||
PkmnLib::Battling::Battle* PkmnLib::Battling::Battle::Clone() const {
|
||||
auto parties = ArbUt::List<CreatureLib::Battling::BattleParty*>(_parties.Count());
|
||||
for (auto* party : _parties) {
|
||||
parties.Append(party->Clone());
|
||||
auto* partyClone = party->Clone();
|
||||
parties.Append(partyClone);
|
||||
for (auto* m : partyClone->GetParty()->GetParty()) {
|
||||
if (m != nullptr) {
|
||||
m->ClearBattleData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto* battle =
|
||||
|
|
Loading…
Reference in New Issue