mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-05-09 12:08:12 +03:00
Finalized actor_patrol
This commit is contained in:
parent
adf081ba3c
commit
6f58b34f87
1 changed files with 34 additions and 30 deletions
|
@ -47,42 +47,46 @@ void Actor::End_Patrol(void)
|
||||||
parm.movefail = true;
|
parm.movefail = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Actor::Resume_Patrol(void)
|
void Actor::Resume_Patrol(void) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void Actor::Think_Patrol(void)
|
void Actor::Think_Patrol(void)
|
||||||
{
|
{
|
||||||
if (Actor::RequireThink()) {
|
bool bMoveInRadius;
|
||||||
parm.movefail = false;
|
|
||||||
|
|
||||||
UpdateEyeOrigin();
|
if (!RequireThink()) {
|
||||||
NoPoint();
|
|
||||||
|
|
||||||
m_pszDebugState = "";
|
|
||||||
m_csPatrolCurrentAnim = STRING_ANIM_PATROL_SCR;
|
|
||||||
|
|
||||||
if (m_fLookAroundFov > 1.0) {
|
|
||||||
LookAround(m_fLookAroundFov);
|
|
||||||
}
|
|
||||||
|
|
||||||
CheckForThinkStateTransition();
|
|
||||||
if (m_patrolCurrentNode) {
|
|
||||||
if (!MoveToPatrolCurrentNode()) {
|
|
||||||
PostThink(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
SetThinkIdle(THINK_IDLE);
|
|
||||||
m_bScriptGoalValid = false;
|
|
||||||
}
|
|
||||||
parm.movedone = true;
|
|
||||||
|
|
||||||
Unregister(STRING_MOVEDONE);
|
|
||||||
|
|
||||||
PostThink(true);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parm.movefail = false;
|
||||||
|
|
||||||
|
UpdateEyeOrigin();
|
||||||
|
NoPoint();
|
||||||
|
|
||||||
|
m_pszDebugState = "";
|
||||||
|
m_csPatrolCurrentAnim = STRING_ANIM_PATROL_SCR;
|
||||||
|
bMoveInRadius = MoveToPatrolCurrentNode();
|
||||||
|
|
||||||
|
if (m_fLookAroundFov > 1.0) {
|
||||||
|
LookAround(m_fLookAroundFov);
|
||||||
|
}
|
||||||
|
|
||||||
|
CheckForThinkStateTransition();
|
||||||
|
|
||||||
|
if (!m_patrolCurrentNode) {
|
||||||
|
SetThinkIdle(THINK_IDLE);
|
||||||
|
m_bScriptGoalValid = false;
|
||||||
|
|
||||||
|
parm.movedone = true;
|
||||||
|
Unregister(STRING_MOVEDONE);
|
||||||
|
} else if (bMoveInRadius) {
|
||||||
|
ClearPatrolCurrentNode();
|
||||||
|
SetThinkIdle(THINK_IDLE);
|
||||||
|
|
||||||
|
parm.movedone = true;
|
||||||
|
Unregister(STRING_MOVEDONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
PostThink(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Actor::ShowInfo_Patrol(void)
|
void Actor::ShowInfo_Patrol(void)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue