mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-14 20:05:02 +00:00
Document Hookshot Attachment (#2300)
* document hookshot attachment * change comment * swap hookshot function comment * remove comments
This commit is contained in:
parent
e0e0e93644
commit
6239f8e0b3
10 changed files with 83 additions and 59 deletions
|
@ -1119,15 +1119,24 @@ s32 func_8002DDF4(PlayState* play) {
|
|||
return player->stateFlags2 & PLAYER_STATE2_12;
|
||||
}
|
||||
|
||||
void func_8002DE04(PlayState* play, Actor* actorA, Actor* actorB) {
|
||||
/**
|
||||
* Swap hookshot attachment state from one actor to another.
|
||||
*
|
||||
* Note: There is no safety check for a NULL hookshot pointer.
|
||||
* The responsibility is on the caller to make sure the hookshot exists.
|
||||
*/
|
||||
void Actor_SwapHookshotAttachment(PlayState* play, Actor* srcActor, Actor* destActor) {
|
||||
ArmsHook* hookshot = (ArmsHook*)Actor_Find(&play->actorCtx, ACTOR_ARMS_HOOK, ACTORCAT_ITEMACTION);
|
||||
|
||||
hookshot->grabbed = actorB;
|
||||
hookshot->grabbedDistDiff.x = 0.0f;
|
||||
hookshot->grabbedDistDiff.y = 0.0f;
|
||||
hookshot->grabbedDistDiff.z = 0.0f;
|
||||
actorB->flags |= ACTOR_FLAG_13;
|
||||
actorA->flags &= ~ACTOR_FLAG_13;
|
||||
hookshot->attachedActor = destActor;
|
||||
|
||||
// The hookshot will attach at exactly the actors world position with 0 offset
|
||||
hookshot->attachPointOffset.x = 0.0f;
|
||||
hookshot->attachPointOffset.y = 0.0f;
|
||||
hookshot->attachPointOffset.z = 0.0f;
|
||||
|
||||
destActor->flags |= ACTOR_FLAG_HOOKSHOT_ATTACHED;
|
||||
srcActor->flags &= ~ACTOR_FLAG_HOOKSHOT_ATTACHED;
|
||||
}
|
||||
|
||||
void func_8002DE74(PlayState* play, Player* player) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue