fix: Rust's December build: no off-mesh links, the field list, the prefab id (#31, #32)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 9s

- Rust removed off-mesh links from its AI (BaseNavigator.IsOnNavMeshLink and its
  traversal are gone), so the brain's reground no longer waits for one (D399).
- The swap's field list, regenerated from staging's Assembly-CSharp (D232):
  58 -> 51 NPC fields, 32 -> 31 brain fields. Seven fields are no longer
  serialised, timeSinceAiming is gone, prefabID -> serializedPrefabID.
- The swap sets our NPC's prefabID after the copy (D398): it is a property now,
  filled only by Unity's deserialisation, so an AddComponent never got it and
  every NPC had prefab id 0 (already true on public since Rust's 11/25 patch).
- README: the update surface names prefabID and drops IsOnNavMeshLink; counts.

Closes #31
Closes #32

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014HJEmd5sBSpNXicS4gmT1t
This commit is contained in:
2026-11-30 23:09:43 -06:00
parent 761a9b6733
commit b9b06a62fa
2 changed files with 14 additions and 15 deletions

View File

@@ -921,7 +921,7 @@ namespace Oxide.Plugins
#region The swap (D223, D232)
// <fieldlist>
// Generated by tools/fieldlist from Rust's Assembly-CSharp.dll, module 5c6eb1c7-ffa2-4b1e-a218-0a66bcc56f9e.
// Generated by tools/fieldlist from Rust's Assembly-CSharp.dll, module b2ee98e0-1091-4c90-b0c6-c52f7a4aac74.
// Do not edit by hand: regenerate after a Rust update (D232).
private static readonly string[] SwapNpcFields =
{
@@ -944,15 +944,9 @@ namespace Oxide.Plugins
"NPCPlayer.damageScale",
"NPCPlayer.shortRange",
"NPCPlayer.attackLengthMaxShortRangeScale",
"BasePlayer.debugCommandedNpcs",
"BasePlayer.GestureViewModel",
"BasePlayer.lastPlayerVisibility",
"BasePlayer.timeSinceAiming",
"BasePlayer.eyeHistory",
"BasePlayer.tickHistory",
"BasePlayer.fallDamageEffect",
"BasePlayer.drownEffect",
"BasePlayer.Belt",
"BaseCombatEntity.spawnDeployableCorpseOnDeath",
"BaseCombatEntity.deployableCorpsePrefab",
"BaseCombatEntity.skeletonProperties",
@@ -967,7 +961,6 @@ namespace Oxide.Plugins
"BaseCombatEntity.sendsMeleeHitNotification",
"BaseCombatEntity.markAttackerHostile",
"BaseCombatEntity.faction",
"BaseEntity.faces",
"BaseEntity.bounds",
"BaseEntity.impactEffect",
"BaseEntity.enableSaving",
@@ -977,7 +970,7 @@ namespace Oxide.Plugins
"BaseEntity.HasBrain",
"BaseEntity.ServerPreProcessed",
"BaseNetworkable.postNetworkUpdateComponents",
"BaseNetworkable.prefabID",
"BaseNetworkable.serializedPrefabID",
"BaseNetworkable.globalBroadcast",
"BaseNetworkable.globalNetworkBehavior",
"BaseNetworkable.globalBuildingBlock",
@@ -991,7 +984,6 @@ namespace Oxide.Plugins
"BaseAIBrain.AllowedToSleep",
"BaseAIBrain.DefaultDesignSO",
"BaseAIBrain.Designs",
"BaseAIBrain.InstanceSpecificDesign",
"BaseAIBrain.SenseRange",
"BaseAIBrain.AttackRangeMultiplier",
"BaseAIBrain.TargetLostRange",
@@ -1123,6 +1115,10 @@ namespace Oxide.Plugins
RunicNpcBrain brain = go.AddComponent<RunicNpcBrain>();
CopyFields(_npcFields, stock, npc);
CopyFields(_brainFields, stockBrain, brain);
// prefabID is a property now (Rust 11/25): Unity's deserialisation fills its encrypted
// value from serializedPrefabID, and an AddComponent never deserialises, so copying the
// field list leaves ours without the prefab's id (#32).
npc.prefabID = stock.prefabID;
UnityEngine.Object.DestroyImmediate(stock, true);
UnityEngine.Object.DestroyImmediate(stockBrain, true);
@@ -1564,7 +1560,9 @@ namespace Oxide.Plugins
{
_nextCheck = now + 2f;
_playerNear = npc.Profile.SleepDistance <= 0f || PlayerWithin(npc.transform.position, npc.Profile.SleepDistance);
if (!Sentry && !Navigator.IsOnNavMeshLink)
// Rust's AI has no off-mesh links any more (staging 27024215, #32): nothing is ever
// mid-link, so there is no traversal left to wait out.
if (!Sentry)
Reground(npc);
_self?.CheckEscort(npc);