Hostile Lock-On (#2193)

* document flag and functions

* format

* adjust comment

* make the comment more public-facing-friendly
This commit is contained in:
fig02
2024-09-13 14:49:55 -04:00
committed by GitHub
parent e6e067428e
commit e658bed27e
7 changed files with 75 additions and 51 deletions
+9 -2
View File
@@ -502,8 +502,15 @@ int Player_InCsMode(PlayState* play) {
return Player_InBlockingCsMode(play, this) || (this->unk_6AD == 4);
}
s32 func_8008E9C4(Player* this) {
return (this->stateFlags1 & PLAYER_STATE1_4);
/**
* Checks if Player is currently locked onto a hostile actor.
* `PLAYER_STATE1_HOSTILE_LOCK_ON` controls Player's "battle" response to hostile actors.
*
* Note that within Player, `Player_UpdateHostileLockOn` exists, which updates the flag and also returns the check.
* Player can use this function instead if the flag should be checked, but not updated.
*/
s32 Player_CheckHostileLockOn(Player* this) {
return (this->stateFlags1 & PLAYER_STATE1_HOSTILE_LOCK_ON);
}
int Player_IsChildWithHylianShield(Player* this) {