Closed TomiBelan closed 2 years ago
This one will take a bit more time.
I thought I had fixed it awhile back.
EDIT: It looks like I need to verify that the amount of tech hasn't changed or increased.
My god, you literally had the answer right there
nextTech->price = TECHPRICE + (countTech () * 50);
And you're right, you technically could get rid of TechSaleData->price, but I think it's fine seeing as it's part of the original code as well. In the future someone may want to have different prices for each tech, keeping it there would make it easier.
Fixed with commit ae5598ae0b570ae915700ca7b42862a60dd47782.
The speed you fixed #99 encouraged me to file another bug. ;)
In hard mode, every time you ask Melnorme about the price of some technology, its price increases. This persists even if you load a saved game and resets when you completely quit the game.
This is caused by the assignment at https://github.com/Serosis/UQM-MegaMod/blob/42829465449679e9efe7cd63bffc560081338252/src/uqm/comm/melnorm/melnorm.c#L1361, which modifies a global variable.
Suggested fix: remove the TechSaleData.price field completely, instead always compute it as
TECHPRICE + (DIF_HARD ? countTech() * 50 : 0)
whenever needed. You could also declare tech_sale_catalog to be const as a preventative measure.