Skip to content

Commit

Permalink
log an error instead of crashing the game when a job errors
Browse files Browse the repository at this point in the history
  • Loading branch information
theFox6 committed Sep 2, 2023
1 parent e0f2b16 commit 1721dea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion working_villagers/job_coroutines.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ function job_coroutines.resume(self,dtime)
self:set_displayed_action(ret[3])
end
else
error("error in job_thread " .. ret[2]..": "..debug.traceback(self.job_thread))
log.error("error in job_thread " .. ret[2]..": "..debug.traceback(self.job_thread))
minetest.chat_send_all("villager " .. self.inventory_name .. " encountered an error in " .. job.description)
self:set_pause(true)
self:set_displayed_action("I encountered an error in my job.")
end
end
end
Expand Down

1 comment on commit 1721dea

@ketwaroo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noice

Please sign in to comment.