'GetPersonalFlag' has the same code as 'GetPirateFlag', all commented out and replaced by a shorter, simpler version - your work, apparently.
Yep, because I couldn't get it to work properly.
I'd welcome if somebody else were to give it a try.
Maybe I overlooked something. I'd hope so!
The main differences seem to be that 'GetPirateFlag' (and the original 'GetPersonalFlag') contains a call on 'Group_GetGroupCommander' - perhaps that doesn't work for anything other than ships?
I can't quite remember now, but I do believe there is some sort of code in place to make fort commanders their own group commander too.
Not sure if that works properly, though...
Ships should not be affected; if I read the code correctly, PirateOverride is only set if the flag is not a ship's flag or pennant.
That is very much correct.
The last time I worked on this code was specifically for
@Jack Rackham's scene where he wanted different pirate ships to show their correct individual flags.
That was the main purpose, so when I couldn't get the fort to behave itself and it kept taking up too much of my time and effort, I gave up and thoroughly simplified the code for pirate forts.
After all, in its current simplified form, at least it isn't
wrong. And it doesn't crash the game anymore either.
But it does misses out on some functionality that does work for Personal.
I think some of the confusion also comes because Pirate has a general nation flag in the fort flag files. This is the one that's used.
To get the customized pirate flags to work for forts, a different flag texture file must be loaded instead.
This means an exception to the regular fort flag code, which makes it extra complex.