PF - Fixed mobs not reaching leaning player
This commit is contained in:
parent
f71d693302
commit
020e928685
@ -143,10 +143,11 @@ bool cMonster::TickPathFinding(cChunk & a_Chunk)
|
|||||||
{
|
{
|
||||||
/* If we reached the last path waypoint,
|
/* If we reached the last path waypoint,
|
||||||
Or if we haven't re-calculated for too long.
|
Or if we haven't re-calculated for too long.
|
||||||
Interval is proportional to distance squared. (Recalculate lots when close, calculate rarely when far) */
|
Interval is proportional to distance squared, and its minimum is 10.
|
||||||
|
(Recalculate lots when close, calculate rarely when far) */
|
||||||
if (
|
if (
|
||||||
((GetPosition() - m_PathFinderDestination).Length() < 0.25) ||
|
((GetPosition() - m_PathFinderDestination).Length() < 0.25) ||
|
||||||
m_TicksSinceLastPathReset > (0.15 * (m_FinalDestination - GetPosition()).SqrLength())
|
((m_TicksSinceLastPathReset > 10) && (m_TicksSinceLastPathReset > (0.15 * (m_FinalDestination - GetPosition()).SqrLength())))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
ResetPathFinding();
|
ResetPathFinding();
|
||||||
|
@ -182,7 +182,13 @@ bool cPath::Step_Internal()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Path found.
|
// Path found.
|
||||||
if (CurrentCell->m_Location == m_Destination)
|
if (
|
||||||
|
(CurrentCell->m_Location == m_Destination + Vector3i(0, 0, 1)) ||
|
||||||
|
(CurrentCell->m_Location == m_Destination + Vector3i(1, 0, 0)) ||
|
||||||
|
(CurrentCell->m_Location == m_Destination + Vector3i(-1, 0, 0)) ||
|
||||||
|
(CurrentCell->m_Location == m_Destination + Vector3i(0, 0, -1)) ||
|
||||||
|
(CurrentCell->m_Location == m_Destination + Vector3i(0, -1, 0))
|
||||||
|
)
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user