-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore ability to spam B to swim faster from OoT (#955)
- Loading branch information
1 parent
9d5e05b
commit 97ce989
Showing
4 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include <libultraship/bridge.h> | ||
#include "2s2h/GameInteractor/GameInteractor.h" | ||
#include "2s2h/ShipInit.hpp" | ||
|
||
extern "C" { | ||
#include "variables.h" | ||
void Player_Action_57(Player* player, PlayState* play); | ||
} | ||
|
||
#define CVAR_NAME "gEnhancements.Restorations.OoTFasterSwim" | ||
#define CVAR CVarGetInteger(CVAR_NAME, 0) | ||
|
||
void RegisterOoTFasterSwim() { | ||
COND_VB_SHOULD(VB_CLAMP_ANIMATION_SPEED, CVAR, { | ||
Player* player = GET_PLAYER(gPlayState); | ||
f32* animationSpeed = va_arg(args, f32*); | ||
|
||
if (player->actionFunc == Player_Action_57 && player->transformation == PLAYER_FORM_HUMAN) { | ||
*should = false; | ||
if (*animationSpeed < 1.0f) { | ||
*animationSpeed = 1.0f; | ||
} | ||
} | ||
}); | ||
} | ||
|
||
static RegisterShipInitFunc initFunc(RegisterOoTFasterSwim, { CVAR_NAME }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters