/// <summary> /// Clean up when it is destroyed /// </summary> public override void Destroy(DestroyMode mode = DestroyMode.Vanish) { destroyedFlag = true; //Check if the slotGroup is active >> deregister it if (slotGroup != null) { slotGroup.Notify_LostCell(this.PositionHeld); //slotGroup = null; } base.Destroy(mode); if ((countSteel > 0) && (steelDef != null)) { // create the remaining resources as new resources at the refill position GenSpawn.Spawn(steelDef, refillPos, Map).stackCount = countSteel; countSteel = 0; } if ((countSilver > 0) && (silverDef != null)) { // create the remaining resources as new resources at the refill position GenSpawn.Spawn(silverDef, refillPos, Map).stackCount = countSilver; countSilver = 0; } }
public override void RemoveCell(IntVec3 sq) { base.RemoveCell(sq); slotGroup.Notify_LostCell(sq); }