From 1e2bdf6eff930175dbd541ad806285e56b7c18f3 Mon Sep 17 00:00:00 2001 From: crabman77 Date: Thu, 1 Oct 2015 23:22:41 +0200 Subject: [PATCH] improve arrows trajectoire --- mods/throwing/functions.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mods/throwing/functions.lua b/mods/throwing/functions.lua index 7596941c..a38988d7 100755 --- a/mods/throwing/functions.lua +++ b/mods/throwing/functions.lua @@ -33,12 +33,13 @@ function throwing_get_trajectoire(self, newpos) return {newpos} end local coord = {} - local nx = (self.lastpos["x"] - newpos["x"])/3 - local ny = (self.lastpos["y"] - newpos["y"])/3 - local nz = (self.lastpos["z"] - newpos["z"])/3 + local nx = (newpos["x"] - self.lastpos["x"])/3 + local ny = (newpos["y"] - self.lastpos["y"])/3 + local nz = (newpos["z"] - self.lastpos["z"])/3 + if nx and ny and nz then - table.insert(coord, {x=self.lastpos["x"]-nx, y=self.lastpos["y"]-ny ,z=self.lastpos["z"]-nz }) - table.insert(coord, {x=newpos["x"]+nx, y=newpos["y"]+ny ,z=newpos["z"]+nz }) + table.insert(coord, {x=self.lastpos["x"]+nx, y=self.lastpos["y"]+ny ,z=self.lastpos["z"]+nz }) + table.insert(coord, {x=newpos["x"]-nx, y=newpos["y"]-ny ,z=newpos["z"]-nz }) end table.insert(coord, newpos) return coord