-- Posessed Door
function obj59()
	local in_range = (math.abs(obj.x() - myobj.x()) < 4*TILE*FRACUNIT)
	if (obj.anim() == 0) then
		if (in_range) then
			obj.anim(1)
		end
	elseif (obj.anim() == 1) then
		if (obj.tics() == 4) then
			if (in_range) then
				obj.anim(2)
			else
				obj.anim(0)
			end
		end
	elseif (obj.anim() == 2) then
		if (not in_range) then
			obj.anim(1)
		end
	end
end
