Skip to content

Commit

Permalink
* Fix screwed up pathfinding logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
iProgramMC committed May 2, 2024
1 parent 7775a0f commit c521f4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/world/entity/Mob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ void Mob::actuallyHurt(int damage)

bool Mob::removeWhenFarAway()
{
return false;
return true;
}

int Mob::getDeathLoot()
Expand Down
3 changes: 2 additions & 1 deletion source/world/entity/PathfinderMob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ void PathfinderMob::updateAi()
break;
}

pCurrNode = m_path.getCurrentNode();
nodePos = GetNodePosition(pCurrNode, this);
}

Expand All @@ -181,7 +182,7 @@ void PathfinderMob::updateAi()
bool inWater = isInWater();
bool inLava = isInLava();

if (!pCurrNode)
if (pCurrNode)
{
float ang = Mth::atan2(nodePos.z - m_pos.z, nodePos.x - m_pos.x) * 180.0f / float(M_PI) - 90.0f;
float heightDiff = nodePos.y - Mth::floor(m_hitbox.min.y + 0.5f);
Expand Down

0 comments on commit c521f4f

Please sign in to comment.