This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
theoriginalbit's profile picture

[CC1.6+] Mounting System Problem

Started by theoriginalbit, 24 July 2014 - 01:49 PM
theoriginalbit #1
Posted 24 July 2014 - 03:49 PM
VERSION:
Noticed in 1.63, but due to the nature of this bug I'd say it has been around since the start (unchecked however).

DESCRIPTION:
The IMount is unmounted from the computer when the peripheral that has mounted it is removed from the computer, even if there are other peripherals that have mounted the same resource.

EXPECTED RESULT:
The IMount unmounting process to be left fully up to the peripheral, unless the computer is destroyed.

REPRODUCTION STEPS:
  • Have a peripheral mod installed that uses peripheral connection mounting e.g. OpenPeripheral & OpenCCSensors.
  • Place down computer.
  • Place a block that causes a mount down
  • Check the folder is mounted (it is)
  • Place down another block (doesn't matter if it's the same type, just make sure it's the same mount)
  • Check the folder is mounted (it still is)
  • Remove one of the blocks
  • Check the mount is still there (and voila it's gone)

VIDEO:
http://youtu.be/cxFeLKhipic
dan200 #2
Posted 18 September 2014 - 09:59 PM
This is intentional, not a bug
theoriginalbit #3
Posted 19 September 2014 - 01:23 AM
is there a workaround? because this makes for a very bad UX.
dan200 #4
Posted 19 September 2014 - 10:36 AM
I don't want it to be possible for a peripheral to affect a computer it isn't attached to. To do otherwise would be confusing and inconsistent.

Hmm, seems I misunderstood your bug. Your issue is two peripherals mounting literally the same IMount object, I guess I need the perfect solution here would be some kind of reference counting. The workaround for you would be to have the different peripherals mount different objects, that trivially redirect to the real one.
theoriginalbit #5
Posted 13 November 2014 - 11:56 PM
The workaround for you would be to have the different peripherals mount different objects, that trivially redirect to the real one.
For the record, this didn't work. Two instances of the same peripheral, will always have the same IMount class, and mount path, regardless of whether they're the same instance or not it still unmounted the IMount when one of any of the peripherals were detached.