The code for increasing the purchase price of a ship with upgrades seems to work fine, but if the player applies an upgrade to his ship, the sale price he gets does not seem to go up at all. At least, in multiple tests applying and removing upgrades, I did not see any difference. Tested with bronze cannons and stay sails.
Here is the code that is supposed to add to the sale price but doesn't seem to do so:
int idx=0;
for (int i = 0; i < SHIPUPGRADES_QUANTITY; i++) {
idx++;
attributeName = "pic" + idx;
string upgrade = GetShipUpgradeID(i);
if (cn >= 0 && CheckTun(cn, upgrade) == true) {
price += makeint(GetCostTun(cn, upgrade, PRICE_TYPE_SELL)/10); //If an upgrade is applied, you get a percentage of the real price. This can be max of 10%
}
}
Here is the code that is supposed to add to the sale price but doesn't seem to do so:
int idx=0;
for (int i = 0; i < SHIPUPGRADES_QUANTITY; i++) {
idx++;
attributeName = "pic" + idx;
string upgrade = GetShipUpgradeID(i);
if (cn >= 0 && CheckTun(cn, upgrade) == true) {
price += makeint(GetCostTun(cn, upgrade, PRICE_TYPE_SELL)/10); //If an upgrade is applied, you get a percentage of the real price. This can be max of 10%
}
}