Looking at code in CMV3.1.5 ShipsUtilities.c there seems to be some really odd code here.
Function SetShipyardStore
iTest_ship == 1 so SHIP_Gunboat and SHIP_BERMSLOOP will never be produced
same again for
Only SHIP_Cutter will be produced
another
means iTest_ship will be either 0,1 or 2 meaning anything below
is irrelevant and will never be generated.
and there are cases of iTest_ship = rand(70); but then maximum check is at (iTest_ship == 28).
am I missing something?
Attached is the function as I guess it was intended.
View attachment codesnip.txt
Function SetShipyardStore
Code:
iTest_ship = rand(2);
if (iTest_ship == 1)
{
if (iTest_ship == 1)FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_WAR_TARTANE), "ship2");
if (iTest_ship == 2)FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_Gunboat), "ship2");
if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BERMSLOOP), "ship2");
}
iTest_ship == 1 so SHIP_Gunboat and SHIP_BERMSLOOP will never be produced
same again for
Code:
if (iTest_ship == 2)
{
if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BERMSLOOP), "ship2");
if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_Cutter), "ship2");
if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_LuggerVML), "ship2");
if (iTest_ship == 4)FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_WAR_TARTANE), "ship2");
if (iTest_ship == 5)FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_Gunboat), "ship2");
if (iTest_ship == 6) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BERMSLOOP), "ship2");
if (iTest_ship == 7) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_EDINBURG), "ship2");
if (iTest_ship == 8) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_Cutter), "ship2");
}
Only SHIP_Cutter will be produced
another
Code:
iTest_ship = rand(2);
if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BERMSLOOP), "ship3");
if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_Cutter), "ship3");
if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_LuggerVML), "ship3");
if (iTest_ship == 4)FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_WAR_TARTANE), "ship3");
if (iTest_ship == 5)FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_Gunboat), "ship3");
if (iTest_ship == 6) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BERMSLOOP), "ship3");
if (iTest_ship == 7) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_EDINBURG), "ship3");
if (iTest_ship == 8) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_Cutter), "ship3");
if (iTest_ship == 9) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_LUGGER), "ship3");
if (iTest_ship == 10) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_PINK), "ship3");
if (iTest_ship == 11) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_LUGGER_h), "ship3");
if (iTest_ship == 12) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_Galeoth_h), "ship3");
if (iTest_ship == 13) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_Ketch), "ship3");
if (iTest_ship == 14) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_YACHT), "ship3");
if (iTest_ship == 15) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BOUNTY), "ship3");
if (iTest_ship == 16) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_HMS_Bounty), "ship3");
Code:
iTest_ship = rand(2);
Code:
if (iTest_ship == 4)FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_WAR_TARTANE), "ship3");
and there are cases of iTest_ship = rand(70); but then maximum check is at (iTest_ship == 28).
am I missing something?
Attached is the function as I guess it was intended.
View attachment codesnip.txt