scenes/levels: fix two crash in player.lua
This commit is contained in:
parent
2ba1d5cdaa
commit
5f68f2a550
|
@ -199,7 +199,7 @@ end
|
|||
|
||||
function Player:changeWeapon(id)
|
||||
local maxWeapon = #self.stats.weaponList
|
||||
self.weaponID = wrap(id, maxWeapon)
|
||||
self.weaponID = utils.math.wrap(id, 1, maxWeapon)
|
||||
self:setWeapon()
|
||||
end
|
||||
|
||||
|
@ -264,7 +264,7 @@ function Player:die()
|
|||
--self.xsp = 0
|
||||
--self.ysp = 0
|
||||
--currentLevel.world:update(self, self.x,self.y)
|
||||
self.level:setDeathTimer(1)
|
||||
self.manager:setDeathTimer(1)
|
||||
self:destroy()
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue