From f67f9e3b229b1253402a4bc6a0ef2db4a2be3628 Mon Sep 17 00:00:00 2001 From: wtclaude Date: Tue, 29 Sep 2026 02:07:29 -0500 Subject: [PATCH] =?UTF-8?q?fix(bridge):=20the=20three=20members=20the=20ri?= =?UTF-8?q?g=20corrected=20=E2=80=94=20crafter=20owner,=20mission=20assign?= =?UTF-8?q?ee,=20heal=20target?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compiled on both rigs (2026-09-29): ItemCraftTask has no owner, so the crafter is ItemCrafter.owner; OnMissionSucceeded credits its third argument, the assignee, since MissionInstance has no accessor for it; OnHealingItemUse takes its target as object, because GiveEffectsTo now takes an IMedicalToolTarget, and counts only a player. GameObject.ToBaseEntity is not in scope for a plugin, so OnEntityBuilt asks GetComponent(). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY --- overlay/oxide/plugins/RunicGateway.cs | 32 ++++++++++++++++++--------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/overlay/oxide/plugins/RunicGateway.cs b/overlay/oxide/plugins/RunicGateway.cs index d519035..e6641c3 100644 --- a/overlay/oxide/plugins/RunicGateway.cs +++ b/overlay/oxide/plugins/RunicGateway.cs @@ -1959,12 +1959,16 @@ namespace Oxide.Plugins tally.HeliKills++; } - /// No return behaviour. A crafted shirt, rifle or anything else, by its item category. + /// + /// No return behaviour. A crafted shirt, rifle or anything else, by its item category. + /// Who crafted it is the crafter's owner: the task no longer carries one (read off the + /// rig, 2026-09-29). + /// private void OnItemCraftFinished(ItemCraftTask task, Item item, ItemCrafter crafter) { MarkHook("OnItemCraftFinished"); - BasePlayer player = task != null ? task.owner : null; + BasePlayer player = crafter != null ? crafter.owner : null; if (player == null || player.IsNpc || item == null || item.info == null) return; @@ -1979,7 +1983,7 @@ namespace Oxide.Plugins BasePlayer player = planner != null ? planner.GetOwnerPlayer() : null; - if (player == null || player.IsNpc || go == null || !(go.ToBaseEntity() is BuildingBlock)) + if (player == null || player.IsNpc || go == null || go.GetComponent() == null) return; TallyFor(player).Built++; @@ -2019,13 +2023,21 @@ namespace Oxide.Plugins private int _reviveFrame = -1; /// - /// Void: a non-null return refuses the heal. is who is healed; + /// Void: a non-null return refuses the heal. is what is healed; /// the tool's owner is who heals. Healing yourself is not a heal (D174). + /// + /// + /// The target is taken as object: the game's `GiveEffectsTo` now takes an + /// `IMedicalToolTarget`, which is not always a player, and a parameter typed + /// `BasePlayer` would simply never be called for the hook's current shape. Only a + /// player healed counts. + /// /// - private void OnHealingItemUse(MedicalTool tool, BasePlayer player) + private void OnHealingItemUse(MedicalTool tool, object target) { MarkHook("OnHealingItemUse"); + BasePlayer player = target as BasePlayer; BasePlayer healer = tool != null ? tool.GetOwnerPlayer() : null; if (healer == null || healer.IsNpc || player == null || player.IsNpc @@ -2107,16 +2119,16 @@ namespace Oxide.Plugins /// No return behaviour. A mission one of the game's NPCs handed out, finished (D173). A /// failed or abandoned one raises a different hook, and is never counted. /// - private void OnMissionSucceeded(BaseMission mission, BaseMission.MissionInstance instance) + private void OnMissionSucceeded(BaseMission mission, BaseMission.MissionInstance instance, BasePlayer assignee) { MarkHook("OnMissionSucceeded"); - BasePlayer player = instance != null ? instance.GetAssignee() : null; - - if (player == null || player.IsNpc) + // The game hands the assignee over: `MissionSuccess(instance, assignee)`. The instance + // itself has no accessor for it (read off the rig, 2026-09-29). + if (assignee == null || assignee.IsNpc) return; - TallyFor(player).Missions++; + TallyFor(assignee).Missions++; } ///