Sorry, I fear the latest fix for this won't do either. Where you put that section now
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->void BI_LaunchCommand()
{
....
// --> Hoist the flag code fix by Mad-h
int franciarel = (GetRMRelation(GetMainCharacter(),FRANCE));
int spanyolrel = (GetRMRelation(GetMainCharacter(),SPAIN));
int portugalrel = (GetRMRelation(GetMainCharacter(),PORTUGAL));
int hollandrel = (GetRMRelation(GetMainCharacter(),HOLLAND));
int angolrel = (GetRMRelation(GetMainCharacter(),ENGLAND));
switch(commandName)
{
....<!--c2--></div><!--ec2-->
will it run every time you launch a command at sea (maybe only if you use the icon menu at the low margin of the screen, and maybe you don't encounter this bug if you go to the map only with F3 <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid="

" border="0" alt="dunno.gif" />h: )
So if you launch a command AFTER hoisting the pirateflag it stores your piraterelations and the old "before hoisting" relations get lost <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid="

" border="0" alt="sad.gif" />
There seems to be another error, maybe older: The whole old flagraising code has been outcommented by /* ... */ But within that section there was a smaller section already outcommented:
/*SetNationRelation2MainCharacter(PIRATE, RELATION_FRIEND);
....
SetNationRelation2MainCharacter(HOLLAND, RELATION_ENEMY);*/
Putting a /* ... */ within a /* ... */ swallows one end of the comment and messes up the following code terribly ! (Took me HOURS to find that one <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid="

" border="0" alt="sad.gif" /> )
IDEA FOR A SOLUTION
Correct me if I am wrong: this mod shall work this way:
- I approach some ship under a "normal" flag
-Then I hoist the pirateflag. My nationality becomes Pirate, and all non-pirateships shall become hostile
-When I go back to the map my crime shall be forgotten, and the nationrelations that I had before hoisting the pirateflag shall be restored. Shall my old nationality be restored as well?
If that is what you want here is a proposal: instead of using integer variables (which cause problems if they are are called but not defined yet) attach attributes to the maincharacter in order to store the "before hoisting" relations. (And, if desired, the old playernation)
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> switch(commandName)
{
// Hoist Flag MOD -Amokachi
case "BI_HoistFlag":
.....
// --> Hoist the flag code fix by Mad-h
mainChr.franciarel = (GetRMRelation(GetMainCharacter(),FRANCE)); // ccc dec 05
mainChr.spanyolrel = (GetRMRelation(GetMainCharacter(),SPAIN)); // ccc dec 05
mainChr.portugalrel = (GetRMRelation(GetMainCharacter(),PORTUGAL)); // ccc dec 05
mainChr.hollandrel = (GetRMRelation(GetMainCharacter(),HOLLAND)); // ccc dec 05
mainChr.angolrel = (GetRMRelation(GetMainCharacter(),ENGLAND)); // ccc dec 05
// store old playernation
mainChr.oldnation = mainChr.nation; // ccc dec 05
// become an evil pirate
mainChr.nation = PIRATE;
....<!--c2--></div><!--ec2-->
A little bit below the current code has several commands like this
SetNationRelation2MainCharacter(PIRATE, RELATION_FRIEND);
These do not work, cause the function SetNationRelation2MainCharacter has been replaced with SetRMRelation since the marriage mod. So the section that sets our relation with all non-pirates to hostile must read like this:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> // hostile all nations, ally pirates
SetRMRelation(GetMainCharacter(), ENGLAND, REL_WAR);
SetRMRelation(GetMainCharacter(), FRANCE, REL_WAR);
SetRMRelation(GetMainCharacter(), SPAIN, REL_WAR);
SetRMRelation(GetMainCharacter(), PORTUGAL, REL_WAR);
SetRMRelation(GetMainCharacter(), HOLLAND, REL_WAR);
if(GetRMRelation(GetMainCharacter(), PIRATE) < REL_AMNESTY) SetRMRelation(GetMainCharacter(), PIRATE, REL_AMNESTY);<!--c2--></div><!--ec2-->
That makes us a Pirate hated by all nations. If desired I can add the "restore all relations by entering the map" part as well, the part that in it's current form causes the LOM bug <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/w00t.gif" style="vertical-align:middle" emoid="

" border="0" alt="w00t.gif" /> But I wont have time for PotC till Monday.