Wazarr94 / haxball_bot_headless

Ready-to-go scripts and functions for the HaxBall Headless API !
MIT License
46 stars 74 forks source link

Error in HaxBot_v3.js onPlayerJoin handler #5

Closed saviola777 closed 2 years ago

saviola777 commented 5 years ago

Due to the order of calls being

updateTeams();
updateAdmins();
extendedP.push([player.id, player.auth, player.conn, false, 0, 0, false]);

The script will fail because the player in extendedP is accessed before it is created, so the correct ordering should be

extendedP.push([player.id, player.auth, player.conn, false, 0, 0, false]);
updateTeams();
updateAdmins();
Wazarr94 commented 5 years ago

Yes, it's something I had corrected in my own file, thank you for sharing.

I've started to work on this project again, there should be an update soon hopefully.

Wazarr94 commented 2 years ago

new update, won't treat