Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
player.setXp = (xp, { setLevel = true, setDisplay = true, send = true } = {}) => {
player.xp = xp
if (setLevel) player.level = getXpLevel(xp)
if (setDisplay) player.displayXp = distanceToXpLevel(xp)
if (send) player.sendXp()
}