Pass battle pointer along with clone for battleside.
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
2021-04-13 22:45:48 +02:00
parent 8baa647940
commit 8a9a6af0af
3 changed files with 5 additions and 4 deletions

View File

@@ -178,7 +178,7 @@ Battle* Battle::Clone() const {
auto* battle = new Battle(_library, parties, _canFlee, _numberOfSides, _creaturesPerSide);
for (int i = 0; i < _numberOfSides; ++i) {
battle->_sides.Set(i, _sides[i]->CloneWithoutCreatures());
battle->_sides.Set(i, _sides[i]->CloneWithoutCreatures(battle));
// FIXME: This is horrible code to translate the creature from the old battle into the same creature in the
// new battle. This needs to be cleaned up, as it's ugly and slow.
for (int creatureIndex = 0; creatureIndex < _creaturesPerSide; ++creatureIndex) {