Browse Source

Fix: Clientside Crash im UnitInfoPanel

bolt_update
laurids 3 years ago
parent
commit
da971c51c2
2 changed files with 8 additions and 0 deletions
  1. +3
    -0
      Assets/GWConquest/Scripts/District.cs
  2. +5
    -0
      Assets/GWConquest/Scripts/Unit.cs

+ 3
- 0
Assets/GWConquest/Scripts/District.cs View File

@ -66,6 +66,9 @@ namespace GWConquest
Inventory = new Inventory(State, "Inventory"); Inventory = new Inventory(State, "Inventory");
Inventory.StorageCapacity = StorageCapacity; Inventory.StorageCapacity = StorageCapacity;
State.AddCallback("StorageCapacity", () => {
Inventory.StorageCapacity = StorageCapacity;
});
//BoltLog.Info("Setting storage capacity to {0}", StorageCapacity); //BoltLog.Info("Setting storage capacity to {0}", StorageCapacity);
AllDistricts.Add(this); AllDistricts.Add(this);


+ 5
- 0
Assets/GWConquest/Scripts/Unit.cs View File

@ -164,6 +164,11 @@ namespace GWConquest
} }
}); });
State.AddCallback("UnitClass", () => {
Inventory.StorageCapacity = Class.InventorySlots;
Equipment.StorageCapacity = Class.EquipmentSlots;
});
} }
public static Unit SpawnUnit(Zone zone, UnitClass uc, Player player) public static Unit SpawnUnit(Zone zone, UnitClass uc, Player player)


Loading…
Cancel
Save