Author Topic: [FIXED] Trouble with manufacturating some items if too much money is available  (Read 1490 times)

Offline Alex_D

  • Colonel
  • ****
  • Posts: 498
    • View Profile
So, I'm currently playing XCF. I'm late in the game and I amassed a large amount of money, about 4.6 Billion. I noticed that some manufacturing items such as "Open Reinforced Osiron Crate" (cost $2) do not show on the manufacturing screen anymore as available. However, if selected the project manually and forced it, the game will open the crates in the base. The min/max number of items to do (right click on up/down arrows) doesn't work either. Maybe I triggered some sort of variable threshold in the OXCE code.

I mentioned the issue on XCF Matrix and member zRrr suggested: it may be integer overflow in int byFunds = _game->getSavedGame()->getFunds() / manufRule->getManufactureCost(); inside Basescape\ManufactureInfoState.cpp. While funds are 64bit int which can hold something of 10^19, int is signed and can hold max 2,147,483,647. Osiron crate cost $2 to unpack, so once you are past 4.4kkk something, division results go into negative and stuff breaks.

So I report this issue here for further record keeping.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9089
    • View Profile
Re: Trouble with manufacturating some items if too much money is available
« Reply #1 on: November 06, 2023, 08:34:54 pm »
Save?

Offline Alex_D

  • Colonel
  • ****
  • Posts: 498
    • View Profile
Re: Trouble with manufacturating some items if too much money is available
« Reply #2 on: November 06, 2023, 09:12:04 pm »
Not quite a save of the moment of the same item (Osiron crate), but some other crates are affected.
Go to the second base, inventory shows some ammo boxes available. They should be able to appear on manufacturing, but I think they don't. Yet they can be forcefully made.

Offline Alex_D

  • Colonel
  • ****
  • Posts: 498
    • View Profile
Re: Trouble with manufacturating some items if too much money is available
« Reply #3 on: November 07, 2023, 09:06:15 pm »
So essentially, apparently, if one tries to run a manufacturing job that costs "M" money, and have more than (2,147,483,647)xM in funds, then there may be a problem.