I've told Edgar Attwood that if he lets me out of jail, I'll hire him as a gunner. True to my word, I pay Silehard for his release, then when I get to port I pay Attwood the 1500 to hire him, and he follows me around like a puppy without actually joining my crew.
The reason is that he's assigned to you by the command 'SetOfficersIndex(PChar, -1, sti(NPChar.index));', which puts him into any free officer slot and fails if you already have three officers assigned. But the nice thing about 'SetOfficersIndex' is that it returns an integer - the index of the officer who was displaced by the one just assigned, -1 if the officer being assigned went into a free slot, or the index of the officer being assigned if for any reason the assignment failed. Which means this version of "Edgar Attwood_dialog.c" now does this:
If the function returns Attwood's own index number then the function failed to assign him, so make him a passenger instead.
The reason is that he's assigned to you by the command 'SetOfficersIndex(PChar, -1, sti(NPChar.index));', which puts him into any free officer slot and fails if you already have three officers assigned. But the nice thing about 'SetOfficersIndex' is that it returns an integer - the index of the officer who was displaced by the one just assigned, -1 if the officer being assigned went into a free slot, or the index of the officer being assigned if for any reason the assignment failed. Which means this version of "Edgar Attwood_dialog.c" now does this:
Code:
if (SetOfficersIndex(PChar, -1, sti(NPChar.index)) == sti(NPChar.index))
{
AddPassenger(PChar, NPChar, 0);
Characters[sti(NPChar.index)].location = "none";
}