From 970655737ce7f497f0725d28605fc296c9923a64 Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 6 Apr 2017 16:16:05 +0200 Subject: Hotfix for destroyed body crash --- not/Player.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'not/Player.lua') 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) -- cgit v1.1