1. When I launched the spaceship I wasn't at war with anyone. The very next turn Siam declared war on me and launched an attack into my domain. On my next turn I went to attack the aggressor Siamese, and I got a prompt asking if I wanted to declare war.
I'm not going to deny responsibility for this one, because it's WAY too coincidental that this happens right at the point in the game where I'm screwing around with peace treaties in Lua. But I looked at the code, and I just don't see how it COULD be doing what you described. The logic isn't very complex: when any player launches a ship, it gets his Team number. The game then loops over all teams in the game; if they're currently at war with the Team in question, and the other team isn't a Barbarian, then it executes the Team:MakePeace() function.
(The whole "team" thing is really annoying, by the way. Techs and treaties are done by team, while everything else is by player...)
Ooh, something I just thought of; do peace treaties go both ways, internally? That is, if I change Teams[1]:MakePeace[2], then Team 1 is no longer at war with Team 2, but does it automatically do the reverse as well, or do I also need to add a Teams[2]:MakePeace[1]? Obviously, war and peace declarations in the UI do this, but I'm not quite so sure about Lua hacked peace. I should test that.
So, to try to track this down, I'd like to know a couple things:
1> Had Siam launched their own spaceship? Had anyone other than you launched, at all?
2> Had you ever been at war with Siam previously? (It COULD be similar to the Open Borders bug, and the game just didn't correctly register you as being at peace with them.)
Now, I'm considering tossing that block of code out entirely. The idea I'm toying with is a true World Peace; as soon as ANY civ launches a ship, the planet enters a state of permanent peace (literally using the Permanent War/Peace flags to try to prevent any wars from being declared). I'm not sure whether Barbarians would count for this; I'd probably keep them at war with everyone.
This lockout would end at the Breakout; while you'd have to start up your wars again the hard way, it'd at least be possible again. I wasn't going to do this previously, when the Breakout's timing was very random, but now that it's basically hard-coded into a 10-30 turn window, I think this idea would work better. And I kind of like the idea of not allowing any fighting for a couple decades, while everyone's going through Golden Ages and rebuilding.
2. Concerning the landlocked destroyer: don't know how that occured. It was definately there, as it intercepted my incoming aircraft.
I've seen things like that before. My guess is that the destroyer was in someone's territory when an Open Borders ended or a border expanded onto its hex, which snapped it back to the nearest "safe" hex. I'd then guess that the dev responsible for this particular mechanism used the wrong IsWater flag so it's thinking a river hex was a valid spot. (Since coastal cities are designed to allow ships inside, it'd snap to the city hex if it was nearby.)
I actually am having a very similar problem in this mod now. Spore Towers are only supposed to spawn Isles of the Deep if they're coastal, which is convenient since their distribution skews towards the coasts. But I've seen inland towers spawning them lately, and I think it happens when they're on rivers. On the plus side, they won't stay landlocked; at the start of the next turn they'll snap to the nearest valid hex; in the case of my Isles, this ends up with a bunch of them spawning off the nearest coast point. (It's also very similar to how my Geosynchronous Survey Pods work. They're Air units without the Immobile flag, so they can do two move actions per turn and then snap back to their starting point. The game only checks to see if a unit is where it's supposed to be at the end of each turn, and if it's not, it uses some primitive logic to move it to a valid spot.)
4. Found the "aquatic spaceship launch" relatively amusing, as I'd never seen that before.
It's very rare, but the game allows it. No matter which city you build the Apollo in, the launch animation will happen in your capital. When a capital is captured, the new capital will be whatever city has the highest population (and that IS his capital). So if you've got an aquatic city with a lighthouse and a few food resources (I count three in that screenshot, plus a land hex), it could easily qualify, especially if the civ is Siam and he's befriended a few Maritimes.
Of course, this sucks for the launching civ, because trying to get spaceship parts TO the capital would be a major problem. But then again, if you've lost so many cities that your capital is a remote island, then you've got worse concerns than losing the space race.