fixed bug were pathfinding wouldn't work

fixed race condition with "await"
gets death position before attempting to path find to death position
This commit is contained in:
Lawtro37 2024-10-30 23:01:46 +10:00 committed by GitHub
parent f827bb0a20
commit 015bf686ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1194,7 +1194,7 @@ export async function goToDeath(bot, agent) {
* @example
* await skills.goToDeath(bot);
**/
let death_pos = agent.memory_bank.recallPlace('last death position')[0]; // <- dont even ask why this is an array
let death_pos = await agent.memory_bank.recallPlace('last death position')[0]; // <- dont even ask why this is an array
if (death_pos) {
await goToPosition(bot, death_pos.x, death_pos.y, death_pos.z);
log(bot, `You have reached the death point.`);