Fix bug in player.js that caused the level editor to crash