Mark my words: "The only issue is how far the water tank from the chimney since there is a code requirement". Any reputable HVAC tradesman knows code better than you and me.
Disclosure: From the pictures OP posted, I can see the leaked tank is almost identical to the one I used to have. I changed it 5 years ago. One rep from Sampleheating sent by LOWE'S tried to lecture me about the code and advantage of power vented. I politely sent him out without letting him complete his measurements. I have done enough homework, and I know what I am doing. In other words, I don't buy what they sell, I buy what I need.