OpenXcom Forum

OpenXcom Forks => OXCE Bugs => OpenXcom Extended (OXCE) => OXCE Bugs FIXED => Topic started by: Finnik on September 30, 2024, 05:54:06 pm

Title: [FIXED] Amiga thinking divide by 0 base unit TU
Post by: Finnik 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.
Title: Re: [FIXED] Amiga thinking divide by 0 base unit TU
Post by: Meridian on September 30, 2024, 11:09:15 pm
Fixed.

https://github.com/MeridianOXC/OpenXcom/commit/84166a5f4d583ea9a30246918087ea00c6062776