This bug made the whole "different random characters are generated in different ways" issue stand out quite notably:
Fix in Progress - Coast Raider Captains Receive No Weapons | PiratesAhoy!
But shouldn't "generate captain of random ship" not be a general function that can be reused no matter what?
Right now, I know that WorldMap, Coast Raiders and Quest ships are created 100% independently.
So maybe instead of just getting captains in line with their ships, we should broaden this feature request to clean up the whole "captain and ship generation code".
This may go as far as ensuring they all get appropriate cargoes and ALL are affected by the difference between war/trade/pirate ships.
Maybe even use
GiveShip2Character to hand out ALL ships to ALL random characters.
That way we'd have single functions controlling everything, which would make things much easier to mod.
Might even make this feature here more feasible to re-enable:
Planned Feature - Include Cannon Weight and Number in Cargo Capacity | PiratesAhoy!
Related functions are:
- GenerateQuestShip in quests_common.c - Rewritten by me a few years back so it is more reusable
- RandomCaptain in quests_common.c - Gets random PIRATE captain model without using the "model array" (ideally this function should not even EXIST!!!)
- InitQuestCaptain in quests_common.c - Does as it says and creates the captain. In a way that could probably be MASSIVELY improved
- Fantom_AddFantomCharacter in AIFantom.c - Used for worldmap encounters, now uses ClearCharacter to avoid CTDs caused by "reusing dead captains" (done by me a few months ago)
- SetCoastTraffic in sea.c - Used for Coast Raiders around islands, now uses ClearCharacter to avoid CTDs caused by "reusing dead captains" (done by me LAST WEEK)
- LoadShipsToSea in sea.c - Does a whole bunch of things that make me wonder WHY IS THIS DONE HERE??? Should that not be already done before?
This does have the potential to clean up the code quite nicely and give us much more control over what happens.
But as usual, it is also risky to rework such important core game mechanics.
Plus point though is that because it IS a core game mechanic, at least any errors would occur EVERYWHERE and we'd know something needs updating again.
Anyway, thoughts anyone?