Skip to content

Commit 06820da

Browse files
committed
MAP2_S00: func_800DE11C
1 parent a92b858 commit 06820da

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

include/maps/map2/map2_s00.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,6 @@ s32 func_800DC98C(s_SubCharacter* chara, VECTOR3* arg1, VECTOR3* arg2, VECTOR3*
159159

160160
bool func_800DC67C(s_SubCharacter* chara);
161161

162+
void func_800DE11C(s_SubCharacter* chara);
163+
162164
#endif

src/maps/map2_s00/map2_s00.c

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,33 @@ INCLUDE_ASM("asm/maps/map2_s00/nonmatchings/map2_s00", func_800DDF74);
474474

475475
INCLUDE_ASM("asm/maps/map2_s00/nonmatchings/map2_s00", func_800DE034);
476476

477-
INCLUDE_ASM("asm/maps/map2_s00/nonmatchings/map2_s00", func_800DE11C);
477+
void func_800DE11C(s_SubCharacter* chara)
478+
{
479+
s32 pcX;
480+
s32 pcZ;
481+
s32 pcX_2;
482+
s32 pcY_2;
483+
s32 pcZ_2;
484+
s32 angle0;
485+
s32 field_D4;
486+
487+
pcX = g_SysWork.player_4C.chara_0.position_18.vx;
488+
pcZ = g_SysWork.player_4C.chara_0.position_18.vz;
489+
field_D4 = g_SysWork.player_4C.chara_0.field_D4;
490+
angle0 = ratan2(
491+
chara->position_18.vx - g_SysWork.player_4C.chara_0.position_18.vx,
492+
chara->position_18.vz - g_SysWork.player_4C.chara_0.position_18.vz
493+
);
494+
495+
pcX_2 = pcX + FP_MULTIPLY_PRECISE(field_D4, Math_Sin(angle0), Q12_SHIFT);
496+
pcZ_2 = pcZ + FP_MULTIPLY_PRECISE(field_D4, Math_Cos(angle0), Q12_SHIFT);
497+
498+
pcY_2 = func_80080884(pcX_2, pcZ_2);
499+
chara->properties_E4.unk0.field_F8.vx = pcX_2;
500+
chara->properties_E4.unk0.field_F8.vy = pcY_2;
501+
chara->properties_E4.unk0.field_F8.vz = pcZ_2;
502+
sharedFunc_800D4E84_0_s01(chara);
503+
}
478504

479505
#include "maps/shared/sharedFunc_800DE1F8_2_s00.h" // 0x800DE1F8
480506

0 commit comments

Comments
 (0)