port 2D step 2: 40250 item_proto/mob_proto through CLZO and pack://locale/<lang>/
proto.cpp reads the 40250 MIPX/MMPT tables with the ported CLZO/TEA (156-byte TItemTable, 255-byte SMobTable), replacing the m2dev XChaCha20 236/335 reader. Names follow CItemData::GetName / GetMonsterName (szLocaleName, cp1252). GDScript callers load AssetRoot.locale_file() = pack://locale/en/<name>, which makes the EterPack chain runtime-reachable; port-map entries for the functions a coverage run hit move to PORTED/ADAPTED. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -130,12 +130,12 @@ func _test_proto() -> void:
|
||||
return
|
||||
var p: Object = ClassDB.instantiate("Metin2Proto")
|
||||
get_root().add_child(p)
|
||||
var root := AssetRoot.sub("locale/locale/en")
|
||||
if not FileAccess.file_exists(root + "/item_proto"):
|
||||
print(" (skip Metin2Proto load: no item_proto)")
|
||||
var ip := AssetRoot.locale_file("item_proto")
|
||||
if ip == "":
|
||||
print(" (skip Metin2Proto load: no 40250 pack)")
|
||||
p.queue_free()
|
||||
return
|
||||
_ck(p.call("load_item_proto", root + "/item_proto"), "load_item_proto: %s" % p.call("get_last_error"))
|
||||
_ck(p.call("load_item_proto", ip), "load_item_proto: %s" % p.call("get_last_error"))
|
||||
_ck(p.call("item_count") > 1000, "item_count > 1000 (%d)" % p.call("item_count"))
|
||||
var yang: Dictionary = p.call("item", 1)
|
||||
_ck(yang.get("name", "") == "Yang", "item(1).name == Yang")
|
||||
|
||||
Reference in New Issue
Block a user