Skip to content

Commit

Permalink
Fix missing action usability checks for quick transform
Browse files Browse the repository at this point in the history
Fixes #185
  • Loading branch information
leoetlino committed Jan 2, 2022
1 parent 514b56e commit f462a56
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions source/rst/link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ void HandleFastTransform() {
return;
}

// Run some additional action usability checks.
// This is necessary to block Goron Mask usage while having Mystery Milk in the inventory.
const auto check_can_use_action =
util::GetPointer<bool(game::act::Player*, game::GlobalContext*, game::Action)>(0x1e0390);
if (!check_can_use_action(player, nullptr, it->action)) {
util::Print("%s: check_can_use_action returned false, skipping", __func__);
return;
}

util::Print("%s: transforming (%s)", __func__, it->name);

player->action = it->action;
Expand Down

0 comments on commit f462a56

Please sign in to comment.