Move the remaining legacy item template lookups to CObjectTemplate
Dev commands, BuildingManager, ChatManager, ForgeManager, NPCManager, NPC, Warehouse, WorkOrder and ManageNPCMsg now call CObjectTemplate.lookup instead of ItemTemplate.templates.get. Forge production cost reads getItemResourceCosts(). Only the DB loader and linkCacheTemplates still use the legacy class (removed in Task 1.8). Removes the static_item_templates ParityCheck comparator. Final parity (offline p17.py, 7586 rows): every id has a cache template, 0 item_type differences, 0 item_resource_costs differences (84 ITEMs have costs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6b4e9815e0
commit
566870de79
17 files changed
+67
-70
No files matched your search
@@ -12,9 +12,9 @@ import engine.gameManager.DbManager;
|
||||
import engine.gameManager.ForgeManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.Item;
|
||||
import engine.objects.ItemTemplate;
|
||||
import engine.objects.NPC;
|
||||
import engine.objects.Warehouse;
|
||||
import engine.parsers.objects.CObjectTemplate;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
@@ -127,12 +127,12 @@ public class WorkOrder implements Delayed {
|
||||
|
||||
int validation_result = 0;
|
||||
|
||||
ItemTemplate template = ItemTemplate.templates.get(workOrder.templateID);
|
||||
CObjectTemplate template = CObjectTemplate.lookup(workOrder.templateID);
|
||||
|
||||
if (workOrder.vendor.getBuilding() == null)
|
||||
return 58; //58: The formula is beyond the means of this facility
|
||||
|
||||
if (!workOrder.vendor.charItemManager.hasRoomInventory(template.cacheTemplate.getItemWt()))
|
||||
if (!workOrder.vendor.charItemManager.hasRoomInventory(template.getItemWt()))
|
||||
return 30; //30: That person cannot carry that item
|
||||
|
||||
if ((workOrder.prefixToken != 0 || workOrder.suffixToken != 0) &&
|
||||
|
||||
Reference in new issue
Block a user