forked from MagicBane/Server
Writing string of bitset for contracts.
This commit is contained in:
@@ -36,7 +36,7 @@ public class Contract extends AbstractGameObject {
|
||||
private ArrayList<Integer> npcModSuffixTable = new ArrayList<>();
|
||||
private ArrayList<Byte> itemModTable = new ArrayList<>();
|
||||
private ArrayList<Item> sellInventory = new ArrayList<>();
|
||||
private EnumSet<mbEnums.BuildingGroup> allowedBuildings;
|
||||
public EnumSet<mbEnums.BuildingGroup> allowedBuildings;
|
||||
private ArrayList<Integer> buyItemType = new ArrayList<>();
|
||||
private ArrayList<Integer> buySkillToken = new ArrayList<>();
|
||||
private ArrayList<Integer> buyUnknownToken = new ArrayList<>();
|
||||
@@ -89,6 +89,8 @@ public class Contract extends AbstractGameObject {
|
||||
this.equipmentSet = rs.getInt("equipSetID");
|
||||
this.inventorySet = rs.getInt("inventorySet");
|
||||
|
||||
DbManager.ContractQueries.updateAllowedBuildings(this);
|
||||
|
||||
try {
|
||||
String menuoptions = rs.getString("menuoptions");
|
||||
|
||||
@@ -220,10 +222,6 @@ public class Contract extends AbstractGameObject {
|
||||
DbManager.ContractQueries.updateDatabase(this);
|
||||
}
|
||||
|
||||
public EnumSet<mbEnums.BuildingGroup> getAllowedBuildings() {
|
||||
return allowedBuildings;
|
||||
}
|
||||
|
||||
public ArrayList<Integer> getBuyItemType() {
|
||||
return this.buyItemType;
|
||||
}
|
||||
@@ -254,7 +252,4 @@ public class Contract extends AbstractGameObject {
|
||||
return (this.allowedBuildings.contains(building.getBlueprint().getBuildingGroup()));
|
||||
}
|
||||
|
||||
public int getEquipmentSet() {
|
||||
return equipmentSet;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1160,7 +1160,7 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
||||
// Setup equipset for contract
|
||||
|
||||
if (this.contract != null)
|
||||
this.equipmentSetID = this.contract.getEquipmentSet();
|
||||
this.equipmentSetID = this.contract.equipmentSet;
|
||||
|
||||
// Mobiles default to the building guild.
|
||||
|
||||
|
||||
@@ -162,8 +162,9 @@ public class NPC extends AbstractCharacter {
|
||||
|
||||
//838, 950, 1051, 1181, 1251, 1351, 1451, 1501, 1526, 1551, 980101,
|
||||
|
||||
return contract.getAllowedBuildings().contains(BuildingGroup.WALLCORNER) ||
|
||||
contract.getAllowedBuildings().contains(BuildingGroup.WALLSTRAIGHTTOWER);
|
||||
if (contract.allowedBuildings.contains(BuildingGroup.WALLCORNER))
|
||||
return true;
|
||||
return contract.allowedBuildings.contains(BuildingGroup.WALLSTRAIGHTTOWER);
|
||||
}
|
||||
|
||||
//This method restarts an upgrade timer when a building is loaded from the database.
|
||||
|
||||
Reference in New Issue
Block a user