void LoadShipsToSea(int iNumShips, string sGName, int iNation, int iGeraldSails)
{
ref rPlayer = GetMainCharacter();
ref rCommander;
int nflag1, ntex1, nflag2, ntex2;
nflag2 = GetPirateFlag(rPlayer, &ntex2);
for (int j = 0; j < iNumShips; j++)
{
int iFantomIndex = FANTOM_CHARACTERS + iNumFantoms - iNumShips + j;
ref rFantom; makeref(rFantom, Characters[iFantomIndex]);
rFantom.id = "fenc_" + iFantomIndex;
[...]
if (iNation == PIRATE) {
if (j == 0) {
nflag1 = GetPirateFlag(rCommander, &ntex1);
if (nflag1 == nflag2 && ntex1 == ntex2) {
if (nflag1 == 0)
rCommander.Flags.Pirate = nflag1 + 1;
else
rCommander.Flags.Pirate = nflag1 - 1;
}
} else {
rFantom.Flags.Pirate = GetPirateFlag(rCommander, &nflag1);
rFantom.Flags.Pirate.texture = nflag1;
}
}