port 2D step 1: look up root/<cls>_<m/w>.msm first (40250 root pack layout)

40250 playersettingmodule.py loads chrmgr.LoadLocalRaceData("warrior_m.msm") from
root/; m2dev root/msm/ stays as the fallback. equip_model_test checks all 8
races resolve from Eternexus/root with shape 0 under pc/ (0..3) or pc2/ (4..7).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-09-23 01:35:40 +09:00
co-authored by Claude Opus 5
parent 232d0461be
commit 240d2827c6
2 changed files with 22 additions and 1 deletions
+19
View File
@@ -80,6 +80,7 @@ func _ck(c: bool, m: String) -> void:
printerr("FAIL: " + m)
func _init() -> void:
_test_40250_msm()
await _run()
if _fail == 0:
print("PASS: equip_model_test (item_list + weapon swap)")
@@ -88,6 +89,24 @@ func _init() -> void:
printerr("%d check(s) failed" % _fail)
quit(1)
# 40250 root/<cls>_<m/w>.msmplayersettingmodule.py LoadLocalRaceData):8 个种族都经 _ensure_spec 找到,
# 0..3(原始职业性别)在 pc/,4..7(另一性别)在 pc2/。
func _test_40250_msm() -> void:
var root := AssetRoot.client_path().path_join("Eternexus")
if not FileAccess.file_exists(root.path_join("root/warrior_m.msm")):
print(" (skip: no 40250 Eternexus/root)")
return
for r in 8:
var em = EquipModel.new()
em.assets_root = root
em.race = r
em._ensure_spec()
var sh: Dictionary = em._spec.shape(0) if em._spec else {}
_ck(String(sh.get("spec_dir", "")) == root.path_join("root"), "race %d: spec from root/<cls>_<m/w>.msm" % r)
var pc := "pc" if r < 4 else "pc2"
_ck(String(sh.get("path", "")).to_lower().begins_with("d:/ymir work/%s/" % pc), "race %d: shape 0 under %s/" % [r, pc])
em.free()
func _run() -> void:
var assets := AssetRoot.path()
var il_path := assets.path_join("locale/locale/common/item_list.txt")
+3 -1
View File
@@ -526,7 +526,9 @@ func _ensure_spec() -> void:
return
var cls: String = CLASS_OF[race & 3]
var suffix := "w" if race in [1, 3, 4, 6] else "m"
for rel in ["root/msm/%s_%s.msm" % [cls, suffix],
# 40250 的 root 包把 <cls>_<m/w>.msm 放在 root/ 下(playersettingmodule.py chrmgr.LoadLocalRaceData("warrior_m.msm"));m2dev 放在 root/msm/。
for rel in ["root/%s_%s.msm" % [cls, suffix],
"root/msm/%s_%s.msm" % [cls, suffix],
"PC/ymir work/pc/%s/%s.msm" % [cls, cls],
"pc2/ymir work/pc2/%s/%s.msm" % [cls, cls],
"season1/season1/pc/%s.msm" % cls]: