Fixes invalid pointers to a battle dangling when a battle is removed.
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:
@@ -100,8 +100,10 @@ namespace CreatureLib::Battling {
|
||||
_side = side.GetRaw();
|
||||
this->ResetActiveScripts();
|
||||
}
|
||||
|
||||
// region Stat APIs
|
||||
void Creature::ClearBattleData() noexcept {
|
||||
_battle = nullptr;
|
||||
_side = nullptr;
|
||||
}
|
||||
|
||||
bool Creature::ChangeStatBoost(Library::Statistic stat, int8_t diffAmount) {
|
||||
bool changed = false;
|
||||
@@ -133,8 +135,6 @@ namespace CreatureLib::Battling {
|
||||
this->_boostedStats.SetStat(stat, s);
|
||||
}
|
||||
|
||||
// endregion
|
||||
|
||||
const ArbUt::OptionalBorrowedPtr<Battle>& Creature::GetBattle() const { return _battle; }
|
||||
|
||||
const ArbUt::OptionalBorrowedPtr<BattleSide>& Creature::GetBattleSide() const { return _side; }
|
||||
|
||||
Reference in New Issue
Block a user