Fixes for use after free
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:
@@ -83,7 +83,7 @@ void PkmnLib::Battling::Pokemon::AttemptCapture(PkmnLib::Library::Item* catchIte
|
||||
Ensure(_battleData.Side.HasValue());
|
||||
Ensure(!IsFainted());
|
||||
Ensure(IsUsable());
|
||||
Ensure(!GetBattleSide().GetValue()->IsSlotUnfillabe(this)) auto captureLibrary =
|
||||
auto captureLibrary =
|
||||
GetLibrary().ForceAs<const BattleLibrary>()->GetCaptureLibrary();
|
||||
auto result = captureLibrary->TryCatch(this, catchItem, _battleData.Battle.GetValue()->GetRandom());
|
||||
_battleData.Battle.GetValue()->TriggerEventListener<CaptureAttemptEvent>(this, result);
|
||||
|
||||
Reference in New Issue
Block a user