Update to new Arbutils memory model.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -83,7 +83,8 @@ float PkmnLib::Battling::DamageLibrary::GetDamageModifier(CreatureLib::Battling:
|
||||
PKMN_HOOK(OverrideCriticalModifier, attack, attack, target, hitIndex, &critModifier);
|
||||
mod *= critModifier;
|
||||
}
|
||||
float randPercentage = 85 + attack->GetUser()->GetBattle()->GetRandom()->Get(0, 16);
|
||||
Assert(attack->GetUser()->GetBattle().GetValue());
|
||||
float randPercentage = 85 + attack->GetUser()->GetBattle().GetValue()->GetRandom()->Get(0, 16);
|
||||
mod *= randPercentage / 100.0;
|
||||
if (attack->GetUser()->HasType(hitData.GetType())) {
|
||||
float stabModifier = 1.5;
|
||||
|
||||
@@ -36,12 +36,12 @@ void PkmnLib::Battling::ExperienceLibrary::HandleExperienceGain(
|
||||
}
|
||||
|
||||
auto battle = fainted->GetBattle();
|
||||
if (battle == nullptr) {
|
||||
if (!battle.HasValue()) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::unordered_set<CreatureLib::Battling::Creature*> shareExperience;
|
||||
for (const auto& party : battle->GetParties()) {
|
||||
for (const auto& party : battle.GetValue()->GetParties()) {
|
||||
for (const auto& mon : party->GetParty()->GetParty()) {
|
||||
if (mon == nullptr)
|
||||
continue;
|
||||
|
||||
@@ -7,7 +7,8 @@ bool PkmnLib::Battling::MiscLibrary::IsCritical(CreatureLib::Battling::Executing
|
||||
CreatureLib::Battling::Creature* target, uint8_t hit) const {
|
||||
uint8_t critStage = 0;
|
||||
PKMN_HOOK(ModifyCriticalStage, attack, attack, target, hit, &critStage);
|
||||
auto rand = target->GetBattle()->GetRandom();
|
||||
Assert(target->GetBattle().HasValue());
|
||||
auto rand = target->GetBattle().GetValue()->GetRandom();
|
||||
switch (critStage) {
|
||||
case 0: return rand->Get(24) == 0;
|
||||
case 1: return rand->Get(8) == 0;
|
||||
|
||||
Reference in New Issue
Block a user