Yes, it does. When the Pope dies while I'm at war with them, though, I get a warning from the new Pope to stop aggression against the Pope :) giving me two years to withdraw. I've always had an excommunication message too. Maybe all of that does not happen, though, when a leader dies. For the longest time, I thought the only way to end an "X" was for the Pope to die so I guess I'll just have to pay closer attention to the next time I get excommunicated and am not at war with the papacy (although that is very rare for me).
Bookmarks