diff --git a/scripts/autoloads/bullet_manager.gd b/scripts/autoloads/bullet_manager.gd index af900e8..a22ffb8 100644 --- a/scripts/autoloads/bullet_manager.gd +++ b/scripts/autoloads/bullet_manager.gd @@ -148,6 +148,10 @@ func _swap_and_pop(idx: int) -> void: _bullet_contexts.erase(last) elif _bullet_contexts.has(idx): _bullet_contexts.erase(idx) + else: + # idx == last:无搬移,但它的冷数据同样必须清掉, + # 否则遗留在该 key 上被下一颗复用此槽位的子弹继承(erase 缺键为安全 no-op) + _bullet_contexts.erase(idx) _active_count -= 1 # ── 对外接口 ─────────────────────────────────────────────────────