Store CreatureIndex on Creature, includes helper function to get a creatures party from a battle.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
@@ -60,6 +60,7 @@ void BattleSide::SetCreature(ArbUt::OptionalBorrowedPtr<Creature> creature, uint
|
||||
}
|
||||
creature.GetValue()->SetBattleData(_battle, this);
|
||||
creature.GetValue()->SetOnBattleField(true);
|
||||
creature.GetValue()->SetBattleIndex(CreatureIndex(_index, index));
|
||||
for (auto* side : _battle->GetSides()) {
|
||||
if (side == this) {
|
||||
continue;
|
||||
@@ -124,8 +125,8 @@ bool BattleSide::SwapPositions(u8 a, u8 b) {
|
||||
return true;
|
||||
}
|
||||
|
||||
BattleSide *BattleSide::CloneWithoutCreatures(ArbUt::BorrowedPtr<Battle> battle) const {
|
||||
auto *side = new BattleSide(_index, battle, _creaturesPerSide);
|
||||
BattleSide* BattleSide::CloneWithoutCreatures(ArbUt::BorrowedPtr<Battle> battle) const {
|
||||
auto* side = new BattleSide(_index, battle, _creaturesPerSide);
|
||||
side->_choicesSet = _choicesSet;
|
||||
_volatile.Clone(side->_volatile);
|
||||
side->_hasFled = _hasFled;
|
||||
|
||||
Reference in New Issue
Block a user