Make GetRandom in Battle class a pointer.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-02-16 17:24:33 +01:00
parent f3b5f9e8f9
commit 428483e73d
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
3 changed files with 3 additions and 3 deletions

View File

@ -5,6 +5,6 @@ bool CreatureLib::Battling::MiscLibrary::IsCritical(CreatureLib::Battling::Execu
CreatureLib::Battling::Creature* target, uint8_t hit) const { CreatureLib::Battling::Creature* target, uint8_t hit) const {
auto rand = target->GetBattle()->GetRandom(); auto rand = target->GetBattle()->GetRandom();
// HOOK: Increase chance for critical hits. // 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; } bool CreatureLib::Battling::MiscLibrary::CanFlee(FleeTurnChoice* switchChoice) const { return true; }

View File

@ -69,7 +69,7 @@ void Battle::CheckChoicesSetAndRun() {
ChoiceQueue* Battle::GetCurrentTurnQueue() const { return _currentTurnQueue; } ChoiceQueue* Battle::GetCurrentTurnQueue() const { return _currentTurnQueue; }
BattleRandom& Battle::GetRandom() { return _random; } BattleRandom* Battle::GetRandom() { return &_random; }
bool Battle::CreatureInField(const Creature* creature) const { bool Battle::CreatureInField(const Creature* creature) const {
for (auto s : _sides) { for (auto s : _sides) {

View File

@ -56,7 +56,7 @@ namespace CreatureLib::Battling {
void CheckChoicesSetAndRun(); void CheckChoicesSetAndRun();
[[nodiscard]] ChoiceQueue* GetCurrentTurnQueue() const; [[nodiscard]] ChoiceQueue* GetCurrentTurnQueue() const;
BattleRandom& GetRandom(); BattleRandom* GetRandom();
bool CreatureInField(const Creature* creature) const; bool CreatureInField(const Creature* creature) const;