When cloning a battle, ensure the old battle data is always cleared from the cloned party.
	
		
			
	
		
	
	
		
	
		
			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:
		@@ -17,7 +17,13 @@ void PkmnLib::Battling::Battle::ClearWeather() {
 | 
				
			|||||||
PkmnLib::Battling::Battle* PkmnLib::Battling::Battle::Clone() const {
 | 
					PkmnLib::Battling::Battle* PkmnLib::Battling::Battle::Clone() const {
 | 
				
			||||||
    auto parties = ArbUt::List<CreatureLib::Battling::BattleParty*>(_parties.Count());
 | 
					    auto parties = ArbUt::List<CreatureLib::Battling::BattleParty*>(_parties.Count());
 | 
				
			||||||
    for (auto* party : _parties) {
 | 
					    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 =
 | 
					    auto* battle =
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user