Repository navigation
Add sync for CrashFish - #2866
MistaOmega wants to merge 2 commits into
Conversation
013ff91 to
46c958c
Compare
|
Please make sure to follow the process described in this epic in order to add a creature to the whitelist |
There was a problem hiding this comment.
🟢 Approval recommended
The changes follow existing packet/processor and AI-whitelist patterns in the codebase, and the new behavior is narrowly scoped to Crashfish targeting replication.
Pull request overview
This PR extends Nitrox’s AI synchronization for Crashfish-related behavior to address multiplayer desyncs described in #2673 (notably around Crashfish targeting/aggro when affected by the Propulsion Cannon).
Changes:
- Add
ProtectCrashHometo the syncedCreatureActionwhitelist and addCrashto the synced creature whitelist. - Introduce a new
CrashAttackLastTargetpacket plus client/server processors to relay and apply Crashfish “attack last target” behavior. - Add a dynamic patch on
Crash’sIPropulsionCannonAmmo.OnRelease()to broadcast the Crashfish target when it’s released.
File summaries
| File | Description |
|---|---|
| NitroxPatcher/Patches/Dynamic/Crash_OnRelease_Patch.cs | New dynamic patch to emit a packet when a Crashfish is released from the Propulsion Cannon. |
| NitroxClient/GameLogic/AI.cs | Expands AI whitelists and adds a handler to apply Crashfish “attack last target” on receivers. |
| NitroxClient/Communication/Packets/Processors/CrashAttackLastTargetProcessor.cs | New client packet processor that applies the Crashfish target/attack update. |
| Nitrox.Server.Subnautica/Models/Packets/Processors/CrashAttackLastTargetProcessor.cs | New server processor to relay the packet to clients who can see the involved entities. |
| Nitrox.Model.Subnautica/Packets/CrashAttackLastTarget.cs | New packet definition carrying creature + target NitroxIds. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Don't know if it's related to that PR or not but we had a lot of those errors : [21:03:25.117] [ERR-UNITY] NullReferenceException: Object reference not set to an instance of an object
NitroxClient.GameLogic.AI.BroadcastNewAction (Nitrox.Model.DataStructures.NitroxId creatureId, Creature creature, CreatureAction newAction) (at <53e056b29a6d468f9143fdf1e4c5044d>:0)
NitroxPatcher.Patches.Dynamic.Creature_ChooseBestAction_Patch.Postfix (Creature instance, System.Boolean runOriginal, Nitrox.Model.DataStructures.NitroxId state, CreatureAction& result) (at <f9d2ab92ae134068848ef93f1bea8246>:0)
(wrapper dynamic-method) Creature.DMD<Creature::ChooseBestAction>(Creature,single)
Creature.UpdateBehaviour (System.Single time, System.Single deltaTime) (at <c055c80802d14a9db359fbdc91eb371c>:0)
Creature.ScheduledUpdate () (at <c055c80802d14a9db359fbdc91eb371c>:0)
ScheduledUpdateBehaviourSet.CallUpdate (System.Int32 startIndex, System.Int32 numItems) (at <f4997fa4a732463aa415fdc5ebc447b9>:0)
UnityEngine.Debug:LogException(Exception, Object)
ScheduledUpdateBehaviourSet:CallUpdate(Int32, Int32) |
|
|
4fd0423 to
9c5f69b
Compare
Linked Issues / Context
Should conclude the fixes for: #2673
Monos Status
Description of Change
Added ProtectCrashHome to creatureActionWhitelist and Crash to syncedCreatureWhitelist
Synced up the prop cannon onrelease behaviour
Validation
Was able to see crash fish attacking as targeted player
Identified player B seeing crashfish aggro at player A after player A grabbed and released Crashfish with prop cannon
PR Checklist
mainat the time of opening