Skip to content

Commit

Permalink
Fix Opher closing after buying (also fixes black market keystone crash)
Browse files Browse the repository at this point in the history
  • Loading branch information
timoschwarzer committed Nov 25, 2023
1 parent 50879bf commit 4301b19
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions projects/Randomizer/game/shops/opher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,13 @@ namespace {
);
SpellUIExperience::Spend(ui_experience, WeaponmasterItem::GetCostForLevel(this_ptr, level));

if (!Moon::ConditionUberState::EvaluateConditions(this_ptr->fields.Upgrade->fields.DiscountCondition)) {
context->ForceHideScreenOnPurchase = true;
context->Result = app::PurchaseResult__Enum::UsedUpDiscount;
}
// TODO: Make uber states for context->ForceHideScreenOnPurchase to be able to hide the screen after purchase via headers
// The commented code below is vanilla behavior and not suitable for rando.
//
// if (this_ptr->fields.Upgrade->fields.DiscountCondition != nullptr && !Moon::ConditionUberState::EvaluateConditions(this_ptr->fields.Upgrade->fields.DiscountCondition)) {
// context->ForceHideScreenOnPurchase = true;
// context->Result = app::PurchaseResult__Enum::UsedUpDiscount;
// }

auto key = std::make_pair(
this_ptr->fields.Upgrade->fields.AcquiredAbilityType,
Expand Down

0 comments on commit 4301b19

Please sign in to comment.