forked from MineClone5/MineClone5
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:
commit
3971d51d50
|
@ -419,6 +419,10 @@ function ARROW_ENTITY.on_step(self, dtime)
|
||||||
self.object:set_rotation({ x = 0, y = yaw, z = pitch })
|
self.object:set_rotation({ x = 0, y = yaw, z = pitch })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self._in_player and not self.object:get_attach() then
|
||||||
|
self.object:remove()
|
||||||
|
end
|
||||||
|
|
||||||
-- Update internal variable
|
-- Update internal variable
|
||||||
self._lastpos={x=pos.x, y=pos.y, z=pos.z}
|
self._lastpos={x=pos.x, y=pos.y, z=pos.z}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue