Xilmi / OpenXcom

Open-source clone of the original X-Com
http://openxcom.org
GNU General Public License v3.0
19 stars 10 forks source link

Can't delete a building that technically qualifies as an empty hanger in X-Piratez #42

Closed themaster567 closed 5 days ago

themaster567 commented 1 month ago

I have a plantation in X-Piratez that I can't delete. When looking at it carefully, it carries a hanger type of -1 for whatever reason. The particular base has two real hangers, with one ship in it. Even if you transfer the ship to another facility, it continues to give the incredibly unhelpful and undescriptive error of "FACILITY IN USE".

I found a thread on the general forums from earlier this year that is near-identical to my issue so I know that I'm not crazy. The difference is just that I can have zero craft assigned to the base at all, and I still can't remove it.

Save file attached, see 2nd base titled Inner Chambers. I'm using a few small submods, but they're all just tiny modifiers and nothing bad will happen at all if you don't have them. quick.zip

Xilmi commented 5 days ago

I looked into it and the issue is different from the thread you linked. It also has nothing to do with crafts. The issue is also present in regular OXCE, not just BOXCE. The inUse-function returns "BPE_Used", which is the non-specific one that doesn't have any additional descriptive text.

Probably because it's not a facility that occurs in the base-game.

Essentially it is because the following check becomes true:

    if ((~provide & require & missed).any())
    {
        return BPE_Used;
    }

Basically: Because the facility has a functionality that is not being provided by anything else and also made use of, it doesn't allow to be scrapped.

According to the Bootypedia it provides "{Farm}". A similar thing is true for the Sickbay, which provides "{Medical}" and results in the same error, when I try to scrap it.

I think this is a discussion that should be had by Meridian and the author of XPiratez. I see no easy way to fix this without risking breaking stuff I have no clue about. I recommend bringing it up as an issue for regular OXCE.

Edit: I tried something. I went to Piratez.rul and removed the line: provideBaseFunc: [FARM] from STR_HYDROPONICS After I did so, I could remove the Plantation.

So basically it seems as if any building that provides any BaseFunc currently is not destructible as long as it is the only one providing it.

It would be possible to improve the text in this case and likely even include what kind of base-functionality it provides to go along with that. But the question (to Meridian) would be, if this is actually the intended behavior.

As in: What is the actual problem with not having anything that provides "{Farm}" anymore?

Edit 2: I understand it now! This provides/requires-system is some sort of build-order-tech-tree. And you can't scrap something that's required by something else. In this case it's the "Bee-Hive". The "Bee-hive" requires a farm in order to function so it doesn't allow you to scrap the Plantation because of i. So if you want to scrap the Plantation, you first have to scrap the Bee-hive or build something else that provides "Farm"!