If you sell your refineries or silos in D2K you first get money back and then it goes down seemingly because there was money "stored" in the refinery or silo. This doesn't matter how much you have just how much entered said structure. So if you take the money you get and spend it all, and then allow your harvester to collect spice and the sell your refinery you will be left with a small amount of money, in testing about 25% of the money acquired.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
If you run out of resource storage capacity then any excess will be lost. This applies in all mods for sell/destroy (capture transfers the stored funds with the building).
As talked about in IRC, this seems to be independent of storage capacity. If you sell a building that has capacity then you will lose whatever is stored in that building
This bug exists also in the CNC Gold Mod - When you have say, 5 partially filled Silos, and sell one, you LOSE money instead of gain from the sale - what's in the silo is not redistributed.
EG I have 5 silos 10% full. I sell one, so I should get 10% of resources put in other silos, and then like $120 from the sale of that silo, instead I lose 10% of my money total, netting a loss.
I did some other testing. and I think this because whomever wrote the code to "lose" money when you sell full refineries, silos because there is no where for the money to go screwed up big time.
Youtube Video here highlights this bug around this time:
https://youtu.be/53ZydfqppVc?t=702 edited for time URL.
This is an issue still. I'll explain in more detail:
If you are trying to reproduce note this: only resources are affected, not cash(/starting money). What you see on the counter in top right is cash+resources. So get broke, harvest some and sell your ref. You will see.
For example if you have 2 ref each with 2000 capacity and 2000 resources harvested, if you then sell your ref, you will have 1220 (50% of 2000 + sell value) afterwards. which is bogus^^
This is totaly couter-intuitive as i would expect my people to take the spice stored in the ref and put it elsewhere, where it has some space. So to only loose money if my capacity is at MAX, not allways.
See this evidence:


Impact on real gameplay: selling your second ref in a buildorder like pp-rax-ref-ref looses you money instead of gain!
Regression was introduced by #8226.