Made Battle take battleparties as a pointer instead of value for external use.
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:
@@ -15,7 +15,7 @@
|
||||
namespace CreatureLib::Battling {
|
||||
class Battle : public ScriptSource {
|
||||
const BattleLibrary* _library;
|
||||
std::vector<BattleParty> _parties;
|
||||
std::vector<BattleParty*> _parties;
|
||||
bool _canFlee;
|
||||
uint8_t _numberOfSides;
|
||||
uint8_t _creaturesPerSide;
|
||||
@@ -29,7 +29,7 @@ namespace CreatureLib::Battling {
|
||||
ScriptSet _volatile;
|
||||
|
||||
public:
|
||||
Battle(const BattleLibrary* library, std::vector<BattleParty> parties, bool canFlee = true,
|
||||
Battle(const BattleLibrary* library, std::vector<BattleParty*> parties, bool canFlee = true,
|
||||
uint8_t numberOfSides = 2, uint8_t creaturesPerSide = 1)
|
||||
: _library(library), _parties(parties), _canFlee(canFlee), _numberOfSides(numberOfSides),
|
||||
_creaturesPerSide(creaturesPerSide) {
|
||||
@@ -43,6 +43,9 @@ namespace CreatureLib::Battling {
|
||||
for (auto s : _sides) {
|
||||
delete s;
|
||||
}
|
||||
for (auto party : _parties) {
|
||||
delete party;
|
||||
}
|
||||
delete _currentTurnQueue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user