Closed pickle69420 closed 1 year ago
The game's dead, check the previous issues that have been up for months discussing the same bug with no response whatsoever.
So sad
It will give a wierd error about getUnit being undefined
A space is empty if you can walk there (either no other unit occupying the space or no wall). If there's a wall, isEmpty()
will be false
but getUnit()
will be undefined
.
You should check if you have a unit in the space (getUnit() !== undefined
) before calling methods on the unit. Or check if there's no wall first.
Closing this now as the above should fix the issue. Please re-open if it doesn't.
The game's dead, check the previous issues that have been up for months discussing the same bug with no response whatsoever.
The game is not dead - I just don't have time to be as active anymore, and I'm relying more in the community members that want to help.
Sorry for bugging you, but is it just me or is this code supposed to work?
Environment
The warriorjs website.
Steps to reproduce
Use this code on the website level 6 (playTurn function):
It will give a wierd error about getUnit being undefined
In the docs it says that if getUnit is undefined then there is nothing hence isEmpty should be true but the else if runs so i dont know what is happening.
If you use this code though:
It works but isWall() still returns false so my player keeps bumping into wall.
Expected Behavior
isWall and isEmpty should work...
Actual Behavior
It is wierd (maybe my mistake)