Yeah, same here. I had an issue where I couldn't delete a building because some other building was interacting with it in some way. I wrote this mod to allow bypassing that and then added the inventory/container management stuff as well.
This also does not work for me. It lacks the config file too. I have made another mod work. I would really like to delete living quarters and put a 2x2 in their place.
I am wondering if you plan on updating this for the newest version of the game, as of right now it does not work. I could really use this mod right about now.
I'll add that in as an option. I specifically put it behind a toggle because it's really easy to accidentally delete an entire base and have a ton of floating furniture left around.
Yeah but in that case, with the "disable build constraints" mod, you can just reconstruct it even with stuff floating around :) Thanks for the addition! <3
There is one logic issue in the mod (causing that double yield bug reported):
In the ActionDeconstructible_Deconstruct_Postfix method, the parameter must be ref bool ___isDestroying because without ref, the assignment to true will have no effect and the original method also executes. Which then yield double if the object was deconstructible fine without the mod.
The second issue is with slight incompatibility with the stacking mod. isFull is not reliable so you'll have to try to AddItem to the player's inventory, and if that returns false, drop the item.
Yeah, this is my first mod and I misunderstood how Harmony was doing the prefixing. This is now updated in 1.0.0.1 and is much more streamlined. All logic is left to Planet Crafter and I just disable certain logic methods where needed. If the plugin is enabled and the container has inventory, I first transfer that inventory out of the container (into player inventory or the ground) before letting Planet Crafter do it's thing. Much cleaner and working well now.
The newest version (1.0.0.2) is now updated to attempt to add the item to inventory and only drops the item on the floor if that returns false. Hopefully, as you've indicated, that helps it work better with the Stack mod. Thanks again.
15 comments
Edit: Ah. There was a sign in the room that stopped me. Still it would be nice to have this mod working.
In the ActionDeconstructible_Deconstruct_Postfix method, the parameter must be ref bool ___isDestroying because without ref, the assignment to true will have no effect and the original method also executes. Which then yield double if the object was deconstructible fine without the mod.
The second issue is with slight incompatibility with the stacking mod. isFull is not reliable so you'll have to try to AddItem to the player's inventory, and if that returns false, drop the item.
bool flag9 = !___playerInventory.AddItem(worldObject);
if (flag9)
{
Vector3 vector = __instance.gameObjectRoot.transform.position + new Vector3(0f, 1f, 0f);
WorldObjectsHandler.DropOnFloor(worldObject, vector, 1f);
informationsDisplayer.AddInformation(2.5f, groupName, DataConfig.UiInformationsType.DropOnFloor, image);
}
else
{
informationsDisplayer.AddInformation(2.5f, groupName, DataConfig.UiInformationsType.InInventory, image);
}