diff --git a/Assets/Scripts/Controls/InventoryInterface.cs b/Assets/Scripts/Controls/InventoryInterface.cs
index 5cceeb0..28adc3d 100644
--- a/Assets/Scripts/Controls/InventoryInterface.cs
+++ b/Assets/Scripts/Controls/InventoryInterface.cs
@@ -205,7 +205,7 @@ namespace Cyber.Controls {
for (int x = 0; x < ItemGridDimensions.x; x++) {
// Find the item and mesh
int i = x + y * (int) ItemGridDimensions.x;
- Item Item = Inventory.Drive.GetItemAt(x + y * (int) ItemGridDimensions.y);
+ Item Item = Inventory.Drive.GetItemAt(x + y * (int) ItemGridDimensions.x);
Mesh Mesh = null;
if (Item != null) {
Mesh = MeshDB.GetMesh(Item.ModelID);
diff --git a/Assets/Scripts/Items/Drive.cs b/Assets/Scripts/Items/Drive.cs
index 3b1d0ca..f2409fb 100644
--- a/Assets/Scripts/Items/Drive.cs
+++ b/Assets/Scripts/Items/Drive.cs
@@ -98,6 +98,25 @@ namespace Cyber.Items {
return false;
}
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void SwitchSlots(int idx1, int idx2) {
+ Slot Slot1 = GetSlotAt(idx1);
+ Slot Slot2 = GetSlotAt(idx2);
+ SetSlotAt(idx1, Slot2);
+ SetSlotAt(idx2, Slot1);
+ }
+
+ private void SetSlotAt(int idx, Slot slot) {
+ if (idx >= Slots.Length) {
+ IncreaseCapacity(idx - Slots.Length + 1);
+ }
+ Slots[idx] = slot;
+ }
+
///
/// Gets the item at the given index, or null if there is nothing.
///