mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-08-04 06:15:32 +02:00
task init fixes
This commit is contained in:
parent
d0140aa542
commit
58d38af369
1 changed files with 8 additions and 5 deletions
|
@ -66,6 +66,9 @@ export class Task {
|
|||
if (!task) {
|
||||
throw new Error(`Task ${task_id} not found`);
|
||||
}
|
||||
if ((!task.agent_count || task.agent_count <= 1) && this.agent.count_id > 0) {
|
||||
task = null;
|
||||
}
|
||||
|
||||
return task;
|
||||
} catch (error) {
|
||||
|
@ -104,7 +107,7 @@ export class Task {
|
|||
//wait for a bit so inventory is cleared
|
||||
await new Promise((resolve) => setTimeout(resolve, 500));
|
||||
|
||||
if (this.data.agent_number > 1) {
|
||||
if (this.data.agent_count > 1) {
|
||||
var initial_inventory = this.data.initial_inventory[this.agent.count_id.toString()];
|
||||
console.log("Initial inventory:", initial_inventory);
|
||||
} else if (this.data) {
|
||||
|
@ -135,12 +138,12 @@ export class Task {
|
|||
// Finding if there is a human player on the server
|
||||
for (const playerName in bot.players) {
|
||||
const player = bot.players[playerName];
|
||||
if (!available_agents.some((n) => n === name)) {
|
||||
if (!available_agents.some((n) => n === playerName)) {
|
||||
console.log('Found human player:', player.username);
|
||||
human_player_name = player.username
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If there are multiple human players, teleport to the first one
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue