[P1][D13] 掉落落点改用 findSafeDropPosition 的网格螺旋扫描 #422
Labels
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: troytt/diablo2-web#422
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
现状
src/game/engine.ts:889使用findIsometricDropPosition:基于像素偏移(di - dj) * stepX的欧氏散布 + 朴素this.terrain.overlap判定。而
src/game/ground-items.ts中已经存在正确实现findSafeDropPosition,却没有被怪物掉落路径调用。1.13c 真实行为
D2Common.dll的ITEM_Drop以尸体所在 subtile 为中心做网格象限螺旋扫描,逐格要求目标 subtile 为
COLLIDE_NONE,找到第一个空格即放置;同一 subtile 不叠放两件物品。这与项目规则「稀疏/空白格必须完全阻挡
(
COLLIDE_MASK_INVALID/COLLIDE_BLANK | COLLIDE_WALL)」一致。验收标准
findSafeDropPosition,按COLLIDE_WALL | COLLIDE_MASK_INVALID判定。findIsometricDropPosition已无消费者则删除。Resolution Summary (Issue #422 — Commit
9022579)Upgraded
findSafeDropPositioninsrc/game/ground-items.tsandsrc/game/engine.tsto scan discrete isometric collision-grid quadrant spirals grounded on walkable floor sub-tiles (COLLIDE_NONE) with anti-stacking coordinate tracking.Verification:
npx tsc --noEmit(0 errors), full Vitest drop/combat/item/E2E parity suites (100% pass), andscripts/verify-m5.ts/scripts/verify-net.ts(0 problems).