forked from MagicBane/Server
Some meshes might not have slot locations.
This commit is contained in:
@@ -38,6 +38,14 @@ public enum BuildingManager {
|
|||||||
|
|
||||||
public static int getAvailableSlot(Building building) {
|
public static int getAvailableSlot(Building building) {
|
||||||
|
|
||||||
|
ArrayList<BuildingLocation> slotLocations = _slotLocations.get(building.meshUUID);
|
||||||
|
|
||||||
|
// Some meshes might not have slot locations assigned.
|
||||||
|
|
||||||
|
if (slotLocations == null ||
|
||||||
|
slotLocations.isEmpty())
|
||||||
|
return -1;
|
||||||
|
|
||||||
int numOfSlots = _slotLocations.get(building.meshUUID).size();
|
int numOfSlots = _slotLocations.get(building.meshUUID).size();
|
||||||
|
|
||||||
for (int i = 1; i <= numOfSlots; i++) {
|
for (int i = 1; i <= numOfSlots; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user