aliens

Author Topic: [FIXED] Amiga thinking divide by 0 base unit TU  (Read 273 times)

Offline Finnik

  • Commander
  • *****
  • Posts: 502
  • Finnik#0257
    • View Profile
[FIXED] Amiga thinking divide by 0 base unit TU
« on: September 30, 2024, 05:54:06 pm »
Found a potential crash for feature https://github.com/723Studio/OpenXcom_FTA/commit/4e88674019846454586011a8ccf7179edac782f0

total += bu->reselectAllowed() ? bu->getTimeUnits() * 100 / bu->getBaseStats()->tu : 0;

Some units that act like a furniture for player to kill (like I have it, as I don't like specific tile destruction mechanic in vanilla) might have tu: 0 in their ruleset, that produces a crash, as there is no checks for it.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9009
    • View Profile