diff --git a/src/Battling/Pokemon/CreatePokemon.cpp b/src/Battling/Pokemon/CreatePokemon.cpp index 7aefc6c..4cc3417 100644 --- a/src/Battling/Pokemon/CreatePokemon.cpp +++ b/src/Battling/Pokemon/CreatePokemon.cpp @@ -34,9 +34,7 @@ namespace PkmnLib::Battling { return *this; } - Pokemon* CreatePokemon::Build() { - auto rand = ArbUt::Random(); - + Pokemon* CreatePokemon::Build(ArbUt::Random& rand) { auto species = this->_library->GetSpeciesLibrary()->TryGet(this->_species); if (!species.has_value()) { std::stringstream err; diff --git a/src/Battling/Pokemon/CreatePokemon.hpp b/src/Battling/Pokemon/CreatePokemon.hpp index 0392417..dbe0880 100644 --- a/src/Battling/Pokemon/CreatePokemon.hpp +++ b/src/Battling/Pokemon/CreatePokemon.hpp @@ -67,7 +67,11 @@ namespace PkmnLib::Battling { CreatePokemon& WithNature(const ArbUt::StringView& nature); CreatePokemon& IsAllowedExperienceGain(bool value); - Pokemon* Build(); + Pokemon* Build() { + auto rand = ArbUt::Random(); + return Build(rand); + } + Pokemon* Build(ArbUt::Random& rand); }; } diff --git a/src/ScriptResolving/AngelScript/AngelScriptScript.cpp b/src/ScriptResolving/AngelScript/AngelScriptScript.cpp index 931db23..80c0df1 100644 --- a/src/ScriptResolving/AngelScript/AngelScriptScript.cpp +++ b/src/ScriptResolving/AngelScript/AngelScriptScript.cpp @@ -304,7 +304,7 @@ void AngelScriptScript::ModifyNumberOfHits(CreatureLib::Battling::AttackTurnChoi CreatureLib::Battling::BattleScript* AngelScriptScript::Clone() { auto* ctx = _ctxPool->RequestContext(); auto* obj = _type->Instantiate(ctx); - if (_obj != nullptr){ + if (_obj != nullptr) { obj->CopyFrom(_obj); } _ctxPool->ReturnContextToPool(ctx);