Skip to content

Commit

Permalink
hotfix 10498
Browse files Browse the repository at this point in the history
  • Loading branch information
Raycoms committed Dec 2, 2024
1 parent bb4ba6e commit a8346fd
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ public IAIState patrol()

if (currentPatrolPoint != null)
{
setNextPatrolTargetAndMove(currentPatrolPoint);
setNextPatrolTarget(currentPatrolPoint);
}
}
}
Expand Down Expand Up @@ -562,11 +562,11 @@ public IAIState patrolMine()
final MinerLevel level = buildingMiner.getFirstModuleOccurance(MinerLevelManagementModule.class).getCurrentLevel();
if (level == null)
{
setNextPatrolTargetAndMove(buildingMiner.getPosition());
setNextPatrolTarget(buildingMiner.getPosition());
}
else
{
setNextPatrolTargetAndMove(level.getRandomCompletedNode(buildingMiner));
setNextPatrolTarget(level.getRandomCompletedNode(buildingMiner));
}
}
else
Expand All @@ -589,7 +589,7 @@ public IAIState patrolMine()
*/
public void setNextPatrolTargetAndMove(final BlockPos target)
{
currentPatrolPoint = target;
setNextPatrolTarget(target);
registerTarget(new AIOneTimeEventTarget(() ->
{
if (getState() == CombatAIStates.NO_TARGET)
Expand All @@ -600,6 +600,16 @@ public void setNextPatrolTargetAndMove(final BlockPos target)
}));
}

/**
* Sets the next patrol target.
*
* @param target the next patrol target.
*/
private void setNextPatrolTarget(final BlockPos target)
{
currentPatrolPoint = target;
}

/**
* Check if the worker has the required tool to fight.
*
Expand Down

0 comments on commit a8346fd

Please sign in to comment.