mirror of https://github.com/zeldaret/tmc.git
True match UpdatePlayerInput
This commit is contained in:
parent
040b1f3a59
commit
ed79a24136
|
@ -77,42 +77,36 @@ void UpdatePlayerInput(void) {
|
||||||
u32 prevState;
|
u32 prevState;
|
||||||
PlayerInput* playerInput;
|
PlayerInput* playerInput;
|
||||||
PlayerMacroEntry* playerMacro;
|
PlayerMacroEntry* playerMacro;
|
||||||
u32 zero;
|
|
||||||
|
|
||||||
if (gPlayerState.playerInput.playerMacro != NULL) {
|
if (gPlayerState.playerInput.playerMacro != NULL) {
|
||||||
// Player is controlled by macro.
|
// Player is controlled by macro.
|
||||||
playerInput = &gPlayerState.playerInput;
|
playerInput = &gPlayerState.playerInput;
|
||||||
playerMacro = playerInput->playerMacro;
|
playerMacro = playerInput->playerMacro;
|
||||||
if (playerInput->playerMacroWaiting == 0) { // Execute next macro entry.
|
if (playerInput->playerMacroWaiting == 0) { // Execute next macro entry.
|
||||||
zero = 0;
|
|
||||||
goto code_2;
|
|
||||||
code_0:
|
|
||||||
if (flags != 2) {
|
|
||||||
playerInput->playerMacroWaiting = playerMacro->flags;
|
|
||||||
playerInput->playerMacroHeldKeys = playerMacro->keys;
|
|
||||||
}
|
|
||||||
playerMacro++;
|
|
||||||
playerInput->playerMacro = playerMacro;
|
|
||||||
goto code_4;
|
|
||||||
code_2:
|
|
||||||
do {
|
do {
|
||||||
flags = playerMacro->flags >> 0xe;
|
flags = playerMacro->flags >> 0xe;
|
||||||
if (flags != 1) {
|
if (flags == 1)
|
||||||
break;
|
(u8*)playerMacro += ((s16)playerMacro->keys);
|
||||||
|
else {
|
||||||
|
if (flags == 3) {
|
||||||
|
playerInput->playerMacroWaiting = 0;
|
||||||
|
playerInput->playerMacroHeldKeys = 0;
|
||||||
|
playerMacro = NULL;
|
||||||
|
playerInput->playerMacro = playerMacro;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
if (flags != 2) {
|
||||||
|
playerInput->playerMacroWaiting = playerMacro->flags;
|
||||||
|
playerInput->playerMacroHeldKeys = playerMacro->keys;
|
||||||
|
}
|
||||||
|
playerMacro++;
|
||||||
|
playerInput->playerMacro = playerMacro;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
(u8*)playerMacro += ((s16)playerMacro->keys);
|
|
||||||
} while (TRUE);
|
|
||||||
|
|
||||||
if (flags == 3) {
|
} while (TRUE);
|
||||||
playerInput->playerMacroWaiting = zero;
|
|
||||||
playerInput->playerMacroHeldKeys = zero;
|
|
||||||
playerMacro = NULL;
|
|
||||||
playerInput->playerMacro = playerMacro;
|
|
||||||
} else {
|
|
||||||
goto code_0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
code_4:
|
|
||||||
playerInput->playerMacroWaiting--;
|
playerInput->playerMacroWaiting--;
|
||||||
keys = playerInput->playerMacroHeldKeys;
|
keys = playerInput->playerMacroHeldKeys;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue