Fixes#184.
Note that MM3D does not let you switch from one magic arrow type to
another; that is not a Project Restoration bug and we currently make
no attempt to fix that.
We should *not* access the global context or the player actor manually
in UpdatePadState because neither are guaranteed to still exist in
memory when that function is called.
Fixes random crashes if ZR is held during a transition (transitions
usually involve destructing the current game state and then
reinitialising again -- the global context may be reallocated at a
different location). Closes#146.
Clearing the player's pending cutscene ID is normally done by z_player
before it calls the talk function, but we *must* do it manually before
talking to the owl statue because we are calling the talk function
directly without going through z_player.
Failure to clear the pending cutscene ID can have catastrophic results
because the owl actor triggers a cutscene; we get a nasty deadlock if
the player code also attempts to trigger a cutscene.
The easiest way to trigger this issue was to play the ocarina and then
immediately strike an inactive owl statue.
Fixes#167
I saw this feature being asked for by a few people. Since it shouldn't directly interfere with gameplay, unless specifically activated (pickup item while shielding and swinging). I've checked both on patched and non-patched versions of the game to see if this implementation works, and they both had the same expected behaviour (8 slashes with kokiri sword to kill Gibdos). It appears that this implementation should not impact any regular game play.
* Update common_data.h and main.cpp
Some more decomp'd things like the RespawnData.
Increased assert size due to the fact that sub13s[8] contains respawn data.
Created RespawnData struct.
Found some BitFields that indicate counters for items.
Found bitfiled for sword and shield.
Include enums for sword and shield.
* Keep naming convention.
* Remove extra value in sub13s.
Update raw to u32.
Collect Register didn't change in main?
* Remove old BitField.
* Update inventory registers.
* Include more common_data changes.
Include player changes.
* Update common_data.h and main.cpp
Some more decomp'd things like the RespawnData.
Increased assert size due to the fact that sub13s[8] contains respawn data.
Created RespawnData struct.
Found some BitFields that indicate counters for items.
Found bitfiled for sword and shield.
Include enums for sword and shield.
* Keep naming convention.
* Remove extra value in sub13s.
Update raw to u32.
Collect Register didn't change in main?
* Remove old BitField.
Now that it is impossible to step off floor switches too early and
accidentally trigger block cutscenes in Stone Tower, the block speed
can be slightly decreased (but let's still make it faster than the
default speed).
Also add a slight delay before the block starts moving to make the
cutscene less dizzying. (Thanks to Locke from Zelda Dungeon for
the idea!)
* Spawn the statue as soon as possible.
* Give control to the player only after the statue is at the right
position to help prevent floor switches from resetting.
This replaces the previous "elegy statue cutscene skip" patch.
This changes ui::CheckCurrentScreen to also check that the screen is
not closing, which fixes a softlock in the Bomber's Notebook if
the map is opened while the screen is closing.
Closes#129
This forces the FreezeLink flag to be cleared after an inhale attack
has ended because a very rare bug causes Link to be frozen after
the attack, even though a state handler change is already supposed
to clear the flag.
Fixes a possible softlock when dying while being inhaled by Gyorg.
Prior to this fix, the game would softlock because that sequence of
actions causes Link to exit the "held (by Gyorg or Majora's whips)"
state and eventually enter (and stay in) the frozen state after
the fairy revival cutscene.
Turns out Grezzo doesn't set the icon to 0xFF (None) if the player
doesn't have the ocarina as I remembered... Instead they are simply
hiding the icon widget.
But there is a much better way of checking whether the player has
the ocarina: just check the inventory...
Calling the global context "update usable buttons" function to
determine whether an item is usable is unsafe because of side effects
and might result in item usability being updated too often
(which patches the Restricted Items glitch).