aliens

Author Topic: [FIXED] Base defense crash in rare scenarios [OXC]  (Read 1123 times)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8689
    • View Profile
[FIXED] Base defense crash in rare scenarios [OXC]
« on: October 30, 2022, 02:53:54 pm »
Solarius:

Hi Meridian, we have an interesting bug reported by a player
We investigated and what happened was that he lost all facilities to bombardment (except for the lift), but somehow the craft and people still remained, so once this base was attacked by aliens, no X-Com units could be placed on map
Here are timestamps he provided:
https://youtu.be/qJJH4bJ6XYE?t=19350 - building
https://youtu.be/7kwIazE30v0?t=1657 - first strike
https://youtu.be/7kwIazE30v0?t=2367 - 2nd and 3rd in a row strike
https://youtu.be/7kwIazE30v0?t=3332 - 4th strike

Meridian:

yeah, that's how xcom works
it won't fire any people at the base, at worst it cancels transfers from other bases
you can read more about what happens on facility destruction in comments here: https://github.com/MeridianOXC/OpenXcom/blob/oxce-plus/src/Savegame/Base.cpp#L1872
specifically for living quarters here: https://github.com/MeridianOXC/OpenXcom/blob/oxce-plus/src/Savegame/Base.cpp#L2026
xcom is mean, but it doesn't randomly kill your people, that would be too low even for xcom
as for how to fix this issue... I guess I can just make base defense auto-fail if no xcom units can be placed on the map?
or do you have any other idea(s)?

Solarius:

This seems the best solution.
Also, was the idea to have base inventory check immediately after missile strike dropped? (to see if there is no storage/prison space/living quarters overflow after buildings got destroyed?) This would not kill anyone but force the player to transfer or sell the excess. (Similarly after the base defence, since it can, too, result in buildings getting blown up.)

Meridian:

the check is done once every full hour
is that enough or does it need to be instant?

Solarius:

Hard question... normally it should be enough, but the guy got struck by 2 missiles within 1 hour and this somehow prevented the check from happening. So either this function should be reviewed, or there should be an extra check immediately after bombardment/base defence.

Meridian:

ok, I'll add a check 5 seconds after air strike/base defense
« Last Edit: February 02, 2023, 03:33:32 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8689
    • View Profile
Re: [BUG] base defense crash (in OXC too)
« Reply #1 on: October 30, 2022, 02:54:30 pm »
test saves

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8689
    • View Profile
Re: [BUG] base defense crash (in OXC too)
« Reply #2 on: October 30, 2022, 03:15:01 pm »
1/ I have fixed the crash

2/ As for adding more storage checks, they are already done immediately after a base defense and also immediately after an air strike... you can even see it in the video (after strike 1 and after strike 4)... so nothing to do here I guess