• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Fixed Edgar Attwood does not join if you have no free officer slot

Grey Roger

Sea Dog
Staff member
Administrator
Storm Modder
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:
Code:
       if (SetOfficersIndex(PChar, -1, sti(NPChar.index)) == sti(NPChar.index))
       {
         AddPassenger(PChar, NPChar, 0);
         Characters[sti(NPChar.index)].location = "none";
       }
If the function returns Attwood's own index number then the function failed to assign him, so make him a passenger instead.
 

Attachments

  • Edgar Attwood_dialog.c
    7.5 KB · Views: 154
Back
Top