function gadget:GetInfo()
	return {
	name	= "Turret mover",
	desc	= "Turret on a turret, so you can shoot while you shoot",
	author	= "Argh",
	date	= "December 14, 2009",
	license = "GPL v. 2, (C) Wolfe Games, 2009",
	layer	= 0,
	enabled = false	--	loaded by default?
	}
end

local p,t
local x,y,z   = 0,0,0
local uX, uY, uZ = 0,0

if (gadgetHandler:IsSyncedCode()) then

function getPosition(unitID, ud, team, piece, base)
	p = Spring.GetUnitScriptPiece(unitID,piece)
	b = Spring.GetUnitScriptPiece(unitID,base)
	--t = Spring.GetUnitScriptPiece(unitID,turret)
	--uX, uY, uZ = Spring.GetUnitPosition(unitID)
	x,y,z = Spring.GetUnitPiecePosDir(unitID,p)
	uX, uY, uZ = Spring.GetUnitPiecePosDir(unitID,b)
	--Spring.Echo(x,y,z,uX,uY,uZ)

	x = x - uX
	y = y - uY
	z = z - uZ
	
	Spring.UnitScript.CallAsUnit(unitID,
	function() 
		Spring.UnitScript.Move(1, 1, x)
		Spring.UnitScript.Move(1, 2, y)
		Spring.UnitScript.Move(1, 3, z)
	end)
	
	return unitID, ud, team, x,y,z
end
gadgetHandler:RegisterGlobal("getPosition", getPosition)

end