Add fopAcM_GetLinkId inline

This commit is contained in:
LagoLunatic
2024-07-19 13:51:15 -04:00
parent 287bdab653
commit 00d047c497
2 changed files with 8 additions and 8 deletions
+4
View File
@@ -352,6 +352,10 @@ inline fopAc_ac_c* fopAcM_SearchByName(s16 procName) {
return (fopAc_ac_c*)fopAcIt_Judge(fpcSch_JudgeForPName, &procName);
}
inline fpc_ProcID fopAcM_GetLinkId(const fopAc_ac_c* pActor) {
return pActor->parentActorID;
}
inline void dComIfGs_onItem(int bitNo, int roomNo);
inline void fopAcM_onItem(fopAc_ac_c* item, int bitNo) {
dComIfGs_onItem(bitNo, fopAcM_GetHomeRoomNo(item));
+4 -8
View File
@@ -152,7 +152,7 @@ void daArrow_c::_atHit(dCcD_GObjInf* thisObjInf, fopAc_ac_c* hitActor, dCcD_GObj
void daArrow_c::checkCreater() {
// Check if this arrow was fired by Princess Zelda (during the Ganondorf fight).
fopAc_ac_c* archer;
if (fopAcM_SearchByID(parentActorID, &archer)) {
if (fopAcM_SearchByID(fopAcM_GetLinkId(this), &archer)) {
if (fpcM_GetName(archer) == PROC_PZ) {
mbSetByZelda = true;
}
@@ -542,7 +542,7 @@ void daArrow_c::setKeepMatrix() {
// Transform the arrow onto its archer's hand.
if (mbSetByZelda) {
daPz_c* zelda;
fopAcM_SearchByID(parentActorID, (fopAc_ac_c**)&zelda);
fopAcM_SearchByID(fopAcM_GetLinkId(this), (fopAc_ac_c**)&zelda);
mDoMtx_stack_c::transS(0.7f, -0.07f, -0.2f);
mDoMtx_stack_c::XYZrotM(0x238E, 0x2CDF, 0x29BE);
@@ -1073,12 +1073,8 @@ BOOL daArrow_c::createInit() {
setKeepMatrix();
fopAcM_SetMtx(this, mpModel->getBaseTRMtx());
cull.box.min.x = -6.0f;
cull.box.min.y = -6.0f;
cull.box.min.z = 0.0f;
cull.box.max.x = 6.0f;
cull.box.max.y = 6.0f;
cull.box.max.z = 65.0f;
fopAcM_SetMin(this, -6.0f, -6.0f, 0.0f);
fopAcM_SetMax(this, 6.0f, 6.0f, 65.0f);
mStts.Init(10, 0xFF, this);
mAtCps.Set(m_at_cps_src);