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 2527a44 commit 958279d
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ public IAIState patrol()

if (currentPatrolPoint != null)
{
setNextPatrolTargetAndMove(currentPatrolPoint);
setNextPatrolTarget(currentPatrolPoint);
}
}
}
Expand Down Expand Up @@ -561,11 +561,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 @@ -588,7 +588,7 @@ public IAIState patrolMine()
*/
public void setNextPatrolTargetAndMove(final BlockPos target)
{
currentPatrolPoint = target;
setNextPatrolTarget(target);
registerTarget(new AIOneTimeEventTarget(() ->
{
if (getState() == CombatAIStates.NO_TARGET)
Expand All @@ -599,6 +599,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 958279d

Please sign in to comment.