PR comments

This commit is contained in:
Ethan Roseman 2020-11-08 18:26:29 -05:00
parent a4bdc90eac
commit 2bf9437691
3 changed files with 11 additions and 10 deletions

View File

@ -81,6 +81,7 @@ PlayerData* get_player_data(void);
// Partner // Partner
void func_800EBA3C(Npc* partner); void func_800EBA3C(Npc* partner);
void func_800EBB40(Npc* partner); void func_800EBB40(Npc* partner);
void enable_partner_ai(void);
void enable_partner_walking(Npc* partner, s32 val); void enable_partner_walking(Npc* partner, s32 val);
void enable_partner_flying(Npc* partner, s32 val); void enable_partner_flying(Npc* partner, s32 val);
void update_player_move_history(Npc* partner); void update_player_move_history(Npc* partner);

View File

@ -85,7 +85,7 @@ INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EF300);
INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EF314); INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EF314);
INCLUDE_ASM(s32, "code_838b0_len_5900", enable_partner_ai); INCLUDE_ASM(void, "code_838b0_len_5900", enable_partner_ai, void);
INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EF394, f32 arg0); INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EF394, f32 arg0);

View File

@ -79,29 +79,29 @@ ApiStatus TeleportPartnerToPlayer(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
// currentPartner is being loaded as unsigned instead of signed
#ifdef NON_MATCHING #ifdef NON_MATCHING
ApiStatus func_80283908(ScriptInstance* script, s32 isInitialCall) { ApiStatus func_80283908(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = PLAYER_STATUS; PlayerStatus* playerStatus = PLAYER_STATUS;
PlayerStatus* playerStatus2 = PLAYER_STATUS;
Camera* camera = CURRENT_CAM; Camera* camera = CURRENT_CAM;
s8 currentPartner = PLAYER_DATA->currentPartner;
playerStatus->position.x = GAME_STATUS->savedPos.x; playerStatus->position.x = GAME_STATUS->savedPos.x;
playerStatus->position.y = GAME_STATUS->savedPos.y; playerStatus->position.y = GAME_STATUS->savedPos.y;
playerStatus->position.z = GAME_STATUS->savedPos.z; playerStatus->position.z = GAME_STATUS->savedPos.z;
if (PLAYER_DATA->currentPartner != PartnerId_NONE) { if (currentPartner != PartnerId_NONE) {
Npc* partner = get_npc_unsafe(NpcId_PARTNER); Npc* partner = get_npc_unsafe(NpcId_PARTNER);
f32 angle = clamp_angle(playerStatus->spriteFacingAngle < 180.0f ? 90.0f : -90.0f); f32 angle = clamp_angle((playerStatus2->spriteFacingAngle < 180.0f) ? (90.0f) : (-90.0f));
partner->pos.x = playerStatus2->position.x;
partner->pos.x = playerStatus->position.x; partner->pos.y = playerStatus2->position.y;
partner->pos.y = playerStatus->position.y; partner->pos.z = playerStatus2->position.z;
partner->pos.z = playerStatus->position.z; add_vec2D_polar(&partner->pos.x, &partner->pos.z, playerStatus2->colliderDiameter + 5, angle);
add_vec2D_polar(&partner->pos, &partner->pos.z, playerStatus->colliderDiameter + 5, angle);
enable_partner_ai(); enable_partner_ai();
} }
camera->unk_08 = 1; camera->unk_08 = 1;
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
#else #else