PavelZinchenko / event_horizon

GNU General Public License v3.0
55 stars 21 forks source link

Workshop cost value overflow #46

Closed ViviX12 closed 2 years ago

ViviX12 commented 2 years ago

if a ship is large and costly enough, the workshop cost of upgraded versions can overflow and give money to the player instead of subtracting

juh9870 commented 2 years ago

What do you suggest as a fix? The most direct way would be to rework currencies to use long instead of int but that would require far too much rework to be kept in vanilla. I will definitely do that in EH:CE, but vanilla requires a different fix

ViviX12 commented 2 years ago

without a rework, perhaps cap the maximum cost at the integer limit, so that it can't overflow (instead going back right to the cap)

juh9870 commented 2 years ago

But then it would be uncraftable, cuz player can't effectively get to Int limit without overflowing back into negative

ViviX12 commented 2 years ago

I can't see a solution that wouldn't trade drawbacks

juh9870 commented 2 years ago

Okay, so looks like this will have to wait for EH:CE, I can cap crafting price at 2b credits in a meanwhile

ViviX12 commented 2 years ago

sounds sensible for the time being