summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ghost.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/ghost.lua b/ghost.lua
index 4138e8f..a4bd46d 100644
--- a/ghost.lua
+++ b/ghost.lua
@@ -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