create: Checkpoint 2026-10-19 14:20:14 UTC [9e3662376a]
MemRelay-Operation: checkpoint-save:sotf-grenade-checkpoint-20261019-2219 MemRelay-Resource: 83d6abd0-193c-43e0-bc80-5d7d7f4bedeb
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
title: Checkpoint 2026-10-19 14:20:14 UTC [9e3662376a]
|
||||||
|
type: checkpoint
|
||||||
|
permalink: main/projects/4eb30bec-355e-49d6-909c-e7868faef4f7/checkpoint-2026-10-19-14-20-14-utc-9e3662376a
|
||||||
|
stable_id: 83d6abd0-193c-43e0-bc80-5d7d7f4bedeb
|
||||||
|
scope: project
|
||||||
|
memory_type: checkpoint
|
||||||
|
project_id: 4eb30bec-355e-49d6-909c-e7868faef4f7
|
||||||
|
usage_profile_id: 0c9feb46-d06e-43cd-9ef0-c5813c84a998
|
||||||
|
status: active
|
||||||
|
revision: 1
|
||||||
|
request_id: sotf-grenade-checkpoint-20261019-2219
|
||||||
|
created_at: '2026-10-19T14:20:14.288792+00:00'
|
||||||
|
updated_at: '2026-10-19T14:20:14.288792+00:00'
|
||||||
|
tags:
|
||||||
|
- assist
|
||||||
|
- grenade
|
||||||
|
---
|
||||||
|
|
||||||
|
完成:手榴弹丢出后仍会消失。无限弹药只把 RangedWeapon.Ammo.Remove 的数量改回去,物品不减只在 PlayerInventory.RemoveItem 后把数量补回。手榴弹不走这两条。
|
||||||
|
|
||||||
|
原因:攻击结束时 GrenadeWeaponController.AttackEndCallback 跳到 RangedWeaponController.CheckConsumeThrownItem,再调用 PlayerInventory.ThrowRightHandItem。这个函数先 HasInSlot,再 UnequipItemAtSlot,把右手的物品卸掉。修改器的无限弹药是让 OnAmmoSpent 直接返回,物品不减是让 RemoveItem 直接返回成功,都没挂到 ThrowRightHandItem。
|
||||||
|
|
||||||
|
关键实现:NoThrowConsumePatch 在物品不减或无限弹药开着时跳过 ThrowRightHandItem,并让它返回 true。投掷物仍留在右手。
|
||||||
|
|
||||||
|
验证:Release 编译通过,Mods\SOTFAssist.dll 已覆盖,52736 字节,2026-10-19 22:19。游戏里还没扔过手榴弹。
|
||||||
|
|
||||||
|
下一步:完全退出游戏再进,开任一个开关,扔手榴弹。应该仍能飞出去,手上那个还在。如果手上还在但没有东西飞出去,说明投射物是在卸下物品时才生成的,不要再把整个 ThrowRightHandItem 跳过。
|
||||||
|
|
||||||
|
给下个会话:燃烧瓶的 AttackEndCallback 是另一段,没逐行确认它也调用 ThrowRightHandItem。如果燃烧瓶仍消失,再看这个函数。
|
||||||
Reference in New Issue
Block a user