Remove arrow entities when the player leaves to prevent killing on startup

This commit is contained in:
NO11 2021-12-30 13:12:19 +00:00
parent ad06c5490c
commit 263bb1607d
1 changed files with 4 additions and 0 deletions

View File

@ -419,6 +419,10 @@ function ARROW_ENTITY.on_step(self, dtime)
self.object:set_rotation({ x = 0, y = yaw, z = pitch })
end
if self._in_player and not self.object:get_attach() then
self.object:remove()
end
-- Update internal variable
self._lastpos={x=pos.x, y=pos.y, z=pos.z}
end