Bug fixes and sanity checks.
Because of an awkward implementation in my overload of IsValidPartToModify(part)
, it was possible in some circumstances to spawn multiple while loops a second waiting for the part to have an attachment to check against. I've adjusted the order of execution in a few places to prevent this from happening.
I also fixed a couple things that weren't working correctly, and added some sanity check asserts to prevent accidental misuse on the client.