port: PythonItem + item module (batch 2 P3-b)
Verbatim 40250 CPythonItem and the item Python module replace the pending stand-in and the module stub; CPythonApplication::Create calls m_pyItem.Create() in 40250 order. itemGetIconImage returns its handle through Py_BuildPointer (the ILP32 int truncated it and wndMgr.SetSlot crashed on the live inventory). CMapManager::GetNormal evaluates CTerrain::CalculateNormal on the native height tile; the item text-tail members stay stubs, Pick answering -1 like an empty tail map. The fake server drops vnum 19 next to the actor at entergame and answers CG_ITEM_PICKUP with GC_ITEM_GROUND_DEL; login_flow picks it up through player.PickCloseItem and checks item.SelectItem(19). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f0564a7f12
commit
9298500df9
@@ -436,6 +436,8 @@ extension/third_party/cpython-2.7.18/ # 静态库(2P 批次
|
||||
|
||||
P3-a(2026-09-24):`GameLib/ItemData.cpp`、`GameLib/ItemManager.cpp`、`UserInterface/PythonNonPlayer.cpp` 与 `PythonNonPlayerModule.cpp` 原样移植,删除三个 pending 替身与 nonplayer 模块桩,`initNonPlayer()` 按 40250 顺序插在 `initPlayer()` 之后。`LoadLocaleData` 的函数体原样放进平台 `PythonApplication.cpp`(选角阶段 `localeInfo.LoadLocaleData()` 调它):读 item_list/item_proto/itemdesc 与 mob_proto;`CPythonSkill` 仍是替身,`RegisterSkillDesc` 失败后返回 false(脚本不看返回值),记 ADAPTED。`port.login_flow` 3c 步:物品 19 = Sword+9(武器、refine 9、模型可载),怪 101 = Wild Dog;真服同样通过。下一步 P3-b:`PythonItem` + `PythonItemModule`(地面物品、item 模块)。
|
||||
|
||||
P3-b(2026-09-24):`PythonItem.cpp` 与 `PythonItemModule.cpp` 原样移植,删除 pending 替身与 item 模块桩,`initItem()` 按 40250 顺序在 `initPlayer()` 之后;平台 `CPythonApplication::Create` 按原序调 `m_pyItem.Create()`(dropitem.mse 注册仍落在 CEffectManager 桩)。改动:`itemGetIconImage` 用 `Py_BuildPointer` 返回图标指针(40250 ILP32 用 `"i"`,64 位下被截断,真服背包 `wndMgr.SetSlot` 段错误);`D3DXMath.h` 补 `D3DXQuaternionConjugate`;pending `CMapManager::GetNormal` 以 `CTerrain::CalculateNormal` 公式按需在高度块上算法线;`CPythonTextTail` 的物品名牌四函数暂为桩,`Pick` 按 40250 空表语义返回 -1(返回 0 会把地面物品 VID 0 当作选中,点地移动失效)。假服入场时按 `CItem::EncodeInsertPacket` 发 vnum 19 的 `GC_ITEM_GROUND_ADD`+`GC_ITEM_OWNERSHIP`,收到 `CG_ITEM_PICKUP` 回 `GC_ITEM_GROUND_DEL`;`port.login_flow` 验证地面物品位置/归属/vnum,`player.PickCloseItem()` 发出拾取、物品被删除,以及 `item.SelectItem(19)` 的名称/类型/子类型/数值。下一步 P3-c:`PythonExchange`,之后 `PythonTextTail`(物品名牌)与 `PythonMiniMap`。
|
||||
|
||||
每个切片都必须同时跑 legacy/port 双路回归;只有 2V3 稳定并把默认路由切到 `port` 后,才能删除总开关和剩余 legacy 宿主。
|
||||
|
||||
## 5. 数据源切换:m2dev assets → 40250
|
||||
|
||||
Reference in New Issue
Block a user