Check charters through DeedTemplate
GuildCreationFinalizeHandler and UseCharterMsg now match charters by DeedTemplate._deeds instead of the shared item_type getter, like the other deed paths. Value change: template 545 "Charter" (ITEM folder, CHARTER) no longer counts as a charter. It is a base template that players can't get: its only DB reference is static_vendor_items with vendorType 0, it has no loot rows, and it is not in GuildCharterType.templateLookup, so guild creation already rejected it. JSON-Refactor-Plan Task 1.3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c774746736
commit
6825f94f1e
2 files changed
+11
-2
No files matched your search
@@ -16,6 +16,7 @@ import engine.net.ByteBufferWriter;
|
||||
import engine.net.Protocol;
|
||||
import engine.objects.Item;
|
||||
import engine.objects.PlayerCharacter;
|
||||
import engine.parsers.objects.DeedTemplate;
|
||||
|
||||
|
||||
public class UseCharterMsg extends ClientNetMsg {
|
||||
@@ -61,9 +62,13 @@ public class UseCharterMsg extends ClientNetMsg {
|
||||
|
||||
public void configure() {
|
||||
|
||||
DeedTemplate charterDeed;
|
||||
|
||||
if (close) {
|
||||
for (Item i : player.getInventory()) {
|
||||
if (i.template.cacheTemplate.getItemType().equals(ItemType.CHARTER)) {
|
||||
charterDeed = DeedTemplate._deeds.get(i.templateID);
|
||||
|
||||
if (charterDeed != null && charterDeed.item_type.equals(ItemType.CHARTER)) {
|
||||
charterUUID = i.getObjectUUID();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user