Fixes CreatePokemon initializing invalid moves.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
75d6100689
commit
bb4fd8456c
|
@ -76,7 +76,9 @@ namespace PkmnLib::Battling {
|
||||||
for (size_t i = 0; i < _attacks.Count(); i++) {
|
for (size_t i = 0; i < _attacks.Count(); i++) {
|
||||||
auto& kv = _attacks[i];
|
auto& kv = _attacks[i];
|
||||||
auto move = kv.Move;
|
auto move = kv.Move;
|
||||||
attacks[i] = new LearnedMove(move, kv.LearnMethod);
|
if (move.HasValue()) {
|
||||||
|
attacks[i] = new LearnedMove(move.GetValue(), kv.LearnMethod);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
auto ivs = CreatureLib::Library::ClampedStatisticSet<uint8_t, 0, 31>(_ivHp, _ivAttack, _ivDefense, _ivSpAtt,
|
auto ivs = CreatureLib::Library::ClampedStatisticSet<uint8_t, 0, 31>(_ivHp, _ivAttack, _ivDefense, _ivSpAtt,
|
||||||
_ivSpDef, _ivSpeed);
|
_ivSpDef, _ivSpeed);
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace PkmnLib::Battling {
|
||||||
uint32_t _identifier = 0;
|
uint32_t _identifier = 0;
|
||||||
|
|
||||||
struct ToLearnMethod {
|
struct ToLearnMethod {
|
||||||
ArbUt::BorrowedPtr<const Library::MoveData> Move;
|
ArbUt::OptionalBorrowedPtr<const Library::MoveData> Move;
|
||||||
CreatureLib::Battling::AttackLearnMethod LearnMethod;
|
CreatureLib::Battling::AttackLearnMethod LearnMethod;
|
||||||
ToLearnMethod(ArbUt::BorrowedPtr<const Library::MoveData> move,
|
ToLearnMethod(ArbUt::BorrowedPtr<const Library::MoveData> move,
|
||||||
CreatureLib::Battling::AttackLearnMethod method)
|
CreatureLib::Battling::AttackLearnMethod method)
|
||||||
|
|
Loading…
Reference in New Issue