haxball / haxball-issues

115 stars 43 forks source link

Uncaught TypeError : Cannot read property 'name' of null #1323

Open qoksel00 opened 3 years ago

qoksel00 commented 3 years ago

Few days the bot is fine, I started getting this error. It gives this error when I get up in the morning. The room is frozen. I could not figure it out. Can you help me? Good forums

https://resmim.net/azow8w/

the picture shows the 1399 error line

room.sendAnnouncement("😂 " + getTime(scores) + " 😂 Kendi Kalesine Attı " + lastPlayersTouched[0].name + " ⚽ Gol Hızı : " + ballSpeed.toPrecision(4).toString() + "km/h " + (team == Team.RED ? "🔴" : "🔵"));
Flinch101 commented 3 years ago

Try lastPlayerTouched.name Try lastPlayersTouched.name

Try lastPlayerTouched[0].name Try lastPlayersTouched[0].name

@qoksel00

qoksel00 commented 3 years ago

Try lastPlayerTouched.name Try lastPlayersTouched.name

Try lastPlayerTouched[0].name Try lastPlayersTouched[0].name

@qoksel00

should I just use this replacement for here or for all the same codes

Phantomat0 commented 3 years ago

Would need more information. When does this error occur? When you boot up the room? On a goal?

qoksel00 commented 3 years ago

Would need more information. When does this error occur? When you boot up the room? On a goal?

I found the problem, they found the bot today, the bot starts a 1v1 game first, or when you score a goal very slowly against your own goal, the room counts the goal, but it does not count who scored, so this error falls on the panel, then the game freezes when everyone is out, how do I solve it

emoticons bot Wazarr94

qoksel00 commented 3 years ago

Try lastPlayerTouched.name Try lastPlayersTouched.name

Try lastPlayerTouched[0].name Try lastPlayersTouched[0].name

@qoksel00

I found the problem, they found the bot today, the bot starts a 1v1 game first, or when you score a goal very slowly against your own goal, the room counts the goal, but it does not count who scored, so this error falls on the panel, then the game freezes when everyone is out, how do I solve it

emoticons bot Wazarr94