diff options
author | Fernando Carmona Varo <ferkiwi@gmail.com> | 2015-10-22 20:44:07 +0200 |
---|---|---|
committer | Fernando Carmona Varo <ferkiwi@gmail.com> | 2015-10-22 20:44:07 +0200 |
commit | 1a89f9a8e8e2dd95a1dccb70c10892b604ab434c (patch) | |
tree | 62da84057832a2c4f636a467f1648c074153dc0d /ghost.lua | |
parent | c942b65e33df4cc51202f605d037a2a40883c49e (diff) |
Stop ghosts when the player leaves
Diffstat (limited to 'ghost.lua')
-rw-r--r-- | ghost.lua | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -69,6 +69,12 @@ for i in ipairs(ghosts) do end local player = self.target + -- If there's no player just stop + if not player then + self.set_velocity(self, 0) + return + end + local s = self.object:getpos() -- ghost local p = player:getpos() -- player |