|
|
|
@ -10,6 +10,7 @@ package engine.gameManager;
@@ -10,6 +10,7 @@ package engine.gameManager;
|
|
|
|
|
|
|
|
|
|
import engine.loot.WorkOrder; |
|
|
|
|
import engine.mbEnums; |
|
|
|
|
import engine.net.client.msg.ErrorPopupMsg; |
|
|
|
|
import engine.objects.Item; |
|
|
|
|
import engine.objects.ItemTemplate; |
|
|
|
|
import engine.objects.PlayerCharacter; |
|
|
|
@ -133,6 +134,20 @@ public enum ForgeManager implements Runnable {
@@ -133,6 +134,20 @@ public enum ForgeManager implements Runnable {
|
|
|
|
|
|
|
|
|
|
public static boolean validate(PlayerCharacter playerCharacter, WorkOrder workOrder) { |
|
|
|
|
|
|
|
|
|
ItemTemplate template = ItemTemplate.templates.get(workOrder.templateID); |
|
|
|
|
|
|
|
|
|
if (!workOrder.vendor.charItemManager.hasRoomInventory(template.item_wt)) { |
|
|
|
|
if (playerCharacter != null) |
|
|
|
|
ErrorPopupMsg.sendErrorPopup(playerCharacter, 30); //30: That person cannot carry that item
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!workOrder.vendor.getItemModTable().contains(((byte) template.modTable))) { |
|
|
|
|
if (playerCharacter != null) |
|
|
|
|
ErrorPopupMsg.sendErrorPopup(playerCharacter, 59); //59: This hireling does not have this formula
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// use Warehouse.caclulateOverdraft(workorder) method
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|