Originally posted by Goober5000
Ship_info has one entry for every type of ship, yes, but it also has one entry for every instance of a ship. If this is indeed the root of the problem, the very easy fix would be to change the lookup function from a class lookup to a ship instance lookup.
The individual ships I believe are in the Ships array, not the Ship_info array. Ship_info has room for 130 ships, and has been kept at 130 because raising it any higher breaks other code. (MAX_SHIP_TYPES) On the other hand, Ships has room, currently, for 400 ships. (Originally 100.) Ships, an array of ship structures, is where all the ship specific info is stored. For instance: Escort priority, score, AI type info, alt name info, what kinds of orders are accepted, and much much much more. It's huge compared to the ship_info structure. The latter contains data the game gets from the table files as modified by the mission. The definitions of the two global arrays are below and show that the two are of different sizes, one to hold a list of all the ships and one to hold a list of the ship types.
ship Ships[MAX_SHIPS];
ship_info Ship_info[MAX_SHIP_TYPES];
There are a bunch of other arrays that are used as well, since I believe the ship and ship_info structures don't contain the polymodel data.