Countries cannot profit by war perhaps but that won;t prevent wars. I don't think most wars are entered as the result of a cold economic calculation. They are caused by ancient programs written into our DNA before humans even evolved. So for the time being war is disincentivized by economics but I am confident we will eventually find reasons for a big war anyway