Skip to content

Commit

Permalink
zNPCGoalStd: Call the correct functions in some areas (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgsm authored Aug 1, 2024
1 parent 6cdd771 commit 86d39a2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/SB/Core/x/xBehaviour.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,10 @@ struct xGoal : xListItem<xGoal>, xFactoryInst
return this->goalID;
}

void SetFlags(S32 flags);
void SetFlags(S32 flags)
{
flg_able = flags;
}
void AddFlags(S32 flags);
xPsyche* GetPsyche() const;
void SetCallbacks(xGoalProcessCallback process, xGoalChkRuleCallback chkRule,
Expand Down
8 changes: 4 additions & 4 deletions src/SB/Game/zNPCGoalStd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ S32 zNPCGoalLoopAnim::Enter(F32 dt, void* updCtxt)
flg_info = 0;
lastAnimTime = -1.0f;

return zNPCGoalLoopAnim::Enter(dt, updCtxt);
return zNPCGoalCommon::Enter(dt, updCtxt);
}

S32 zNPCGoalLoopAnim::Exit(F32 dt, void* updCtxt)
Expand Down Expand Up @@ -377,7 +377,7 @@ S32 zNPCGoalIdle::Resume(F32 dt, void* updCtxt)
npc->pflags &= (U8) ~((1 << 3) | (1 << 2) | (1 << 1) | (1 << 0));
}

return xGoal::Resume(dt, updCtxt);
return zNPCGoalCommon::Resume(dt, updCtxt);
}

S32 zNPCGoalIdle::Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* scene)
Expand Down Expand Up @@ -500,7 +500,7 @@ S32 zNPCGoalPatrol::Resume(F32 dt, void* updCtxt)
flg_patrol &= ~(1 << 2);
}

return xGoal::Resume(dt, updCtxt);
return zNPCGoalCommon::Resume(dt, updCtxt);
}

S32 zNPCGoalPatrol::Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* scene)
Expand Down Expand Up @@ -722,7 +722,7 @@ S32 zNPCGoalWander::Enter(F32 dt, void* updCtxt)
F32 dst = 0.75f * rad_wand;
xVec3Copy(&dir_cur, &pos_home);

xVec3AddScaled(&dir_cur, NPCC_rightDir(npc), dst * xurand());
xVec3AddScaled(&dir_cur, NPCC_faceDir(npc), dst * xurand());
dst *= 0.25f;
xVec3AddScaled(&dir_cur, NPCC_rightDir(npc), dst * (2.0f * (xurand() - 0.5f)));

Expand Down
1 change: 1 addition & 0 deletions src/SB/Game/zNPCSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ void NPCSupport_Shutdown();
void NPCSupport_ScenePostInit();
S32 NPCC_LampStatus();
xVec3* NPCC_rightDir(xEnt* ent);
xVec3* NPCC_faceDir(xEnt* ent);
void NPCC_ang_toXZDir(F32 angle, xVec3* dir);
F32 NPCC_aimVary(xVec3* dir_aim, xVec3* pos_src, xVec3* pos_tgt, F32 dst_vary, S32 flg_vary, xVec3* pos_aimPoint);

Expand Down

0 comments on commit 86d39a2

Please sign in to comment.