Merge pull request 'Remove arrow entities when the player leaves to prevent killing on startup (Fix #63)' (#64) from arrow_fix into master

Reviewed-on: MineClone5/MineClone5#64
This commit is contained in:
kay27 2021-12-30 22:27:03 +00:00
commit 3971d51d50
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