Skip to content

Commit

Permalink
Walk somewhere if no tree stumps (ldtteam#8756)
Browse files Browse the repository at this point in the history
If we somehow have a tree with no stumps, walk somewhere instead of crashing. (Completely untested, but seems plausible.)
  • Loading branch information
uecasm authored and Raycoms committed Nov 13, 2022
1 parent abdd5f8 commit 1d940d4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ private IAIState chopTree()

if (job.getTree().hasLogs() || (shouldBreakLeaves && job.getTree().hasLeaves()) || checkedInHut)
{
if (!walkToTree(job.getTree().getStumpLocations().get(0)))
if (!walkToTree(job.getTree().getStumpLocations().isEmpty() ? job.getTree().getLocation() : job.getTree().getStumpLocations().get(0)))
{
if (checkIfStuck())
{
Expand Down

0 comments on commit 1d940d4

Please sign in to comment.