Good news: I've nailed a bug. If the player is going to raise a hostile flag and attack the French ships, he's probably not going to wait - he's going to do it right after he sets sail from Isla Mona, while they're still attached. That doesn't work, and my guess is that the mod to allow you to double-cross a ship you're escorting by raising a hostile flag without pre-warning the captain won't work either. This line, part of HoistFlag(int iNation), is the culprit:
I'd put a trace there to display the values for 'iNation', 'sti(rCharacter.nation)' and 'GetNationRelation(iNation, sti(rCharacter.nation))', and what it displayed for 'GetNationRelation(iNation, sti(rCharacter.nation))' was nothing. Not 0, nothing - blank. The reason turned out to be that the system doesn't like argument 'iNation' being passed directly to another function. I defined a new integer variable 'iNation1', set it equal to 'iNation', then passed that to 'GetNationRelation(iNation1, sti(rCharacter.nation))', and now if I raise a hostile flag while the French ships are companions, they turn hostile - and an escorted merchant will now probably do likewise if you raise a hostile flag, though I've yet to check that. (And also check that it does not turn hostile if you raise a hostile flag after pre-warning the captain.) The modified version of "nations.c" is also attached.
Code:
if(GetNationRelation(iNation, sti(rCharacter.nation)) == RELATION_ENEMY)