diff options
author | Aki <nthirtyone@gmail.com> | 2017-04-06 16:16:05 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-04-06 16:16:05 +0200 |
commit | 970655737ce7f497f0725d28605fc296c9923a64 (patch) | |
tree | 44091cce2b955bf82eba90db1cb3053a0774fa48 /not | |
parent | 2508af1856d4b30678e11fa610c0449bf2135ed0 (diff) | |
download | roflnauts-970655737ce7f497f0725d28605fc296c9923a64.zip roflnauts-970655737ce7f497f0725d28605fc296c9923a64.tar.gz roflnauts-970655737ce7f497f0725d28605fc296c9923a64.tar.bz2 |
Hotfix for destroyed body crash
Diffstat (limited to 'not')
-rw-r--r-- | not/Player.lua | 4 | ||||
-rw-r--r-- | not/World.lua | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/not/Player.lua b/not/Player.lua index 719b77e..30057bb 100644 --- a/not/Player.lua +++ b/not/Player.lua @@ -43,9 +43,9 @@ end -- Update of `Player`. function Player:update (dt) - local x, y = self:getLinearVelocity() Hero.update(self, dt) -- TODO: It would be probably a good idea to add return to update functions to terminate if something goes badly in parent's update. - + if self.body:isDestroyed() then return end + local x, y = self:getLinearVelocity() -- Jumping. if self.isJumping and self.jumpTimer > 0 then self:setLinearVelocity(x,-160) diff --git a/not/World.lua b/not/World.lua index 6e57ac1..d234413 100644 --- a/not/World.lua +++ b/not/World.lua @@ -11,7 +11,6 @@ World = { Effects = nil, Rays = nil, camera = nil, - isActive = true, -- cloud generator clouds_delay = 5, -- Map @@ -234,7 +233,6 @@ end -- LÖVE2D callbacks -- Update ZU WARUDO function World:update (dt) - self.world:update(dt) self.camera:update(dt) -- Engine world: Nauts, Grounds (kek) and Decorations - all Animateds (top kek) |