diff --git a/src/Battling/Library/MiscLibrary.cpp b/src/Battling/Library/MiscLibrary.cpp index 8d2f80d..d6a9c69 100644 --- a/src/Battling/Library/MiscLibrary.cpp +++ b/src/Battling/Library/MiscLibrary.cpp @@ -5,6 +5,6 @@ bool CreatureLib::Battling::MiscLibrary::IsCritical(CreatureLib::Battling::Execu CreatureLib::Battling::Creature* target, uint8_t hit) const { auto rand = target->GetBattle()->GetRandom(); // HOOK: Increase chance for critical hits. - return rand.Get(10) <= 0; + return rand->Get(10) <= 0; } bool CreatureLib::Battling::MiscLibrary::CanFlee(FleeTurnChoice* switchChoice) const { return true; } diff --git a/src/Battling/Models/Battle.cpp b/src/Battling/Models/Battle.cpp index d5d90a5..39fdda6 100644 --- a/src/Battling/Models/Battle.cpp +++ b/src/Battling/Models/Battle.cpp @@ -69,7 +69,7 @@ void Battle::CheckChoicesSetAndRun() { ChoiceQueue* Battle::GetCurrentTurnQueue() const { return _currentTurnQueue; } -BattleRandom& Battle::GetRandom() { return _random; } +BattleRandom* Battle::GetRandom() { return &_random; } bool Battle::CreatureInField(const Creature* creature) const { for (auto s : _sides) { diff --git a/src/Battling/Models/Battle.hpp b/src/Battling/Models/Battle.hpp index 5812c89..1c85a15 100644 --- a/src/Battling/Models/Battle.hpp +++ b/src/Battling/Models/Battle.hpp @@ -56,7 +56,7 @@ namespace CreatureLib::Battling { void CheckChoicesSetAndRun(); [[nodiscard]] ChoiceQueue* GetCurrentTurnQueue() const; - BattleRandom& GetRandom(); + BattleRandom* GetRandom(); bool CreatureInField(const Creature* creature) const;