Skip to content

Commit

Permalink
- check for aggroconsumer on familiars before trying to modify it
Browse files Browse the repository at this point in the history
  • Loading branch information
mfoltz committed Dec 5, 2024
1 parent 00af06b commit a68963a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using ProjectM.Physics;
using ProjectM.Scripting;
using ProjectM.Shared;
using ProjectM.Terrain;
using Stunlock.Core;
using System.Collections;
using Unity.Collections;
Expand Down Expand Up @@ -84,9 +85,8 @@ public static void Initialize()
//DeathEventListenerSystemPatch.OnDeathEvent += FamiliarLevelingSystem.OnUpdate;
DeathEventListenerSystemPatch.OnDeathEvent += FamiliarUnlockSystem.OnUpdate;
}
AffectPrisonerWithToxic

//JobsUtility.JobScheduleParameters
//PrefabLookupUtility.TryGetConvertedAssetDataForPrefab

/*
foreach (var kvp in Server.m_SystemLookup)
Expand Down
4 changes: 4 additions & 0 deletions Utilities/FamiliarUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ public static void ResetAggro(Entity familiar)
if (ServerGameManager.TryGetBuffer<AggroBuffer>(familiar, out var aggroBuffer)) aggroBuffer.Clear();
*/

if (!familiar.Has<AggroConsumer>()) return;

familiar.With((ref AggroConsumer aggroConsumer) =>
{
aggroConsumer.AggroTarget = NetworkedEntity.Empty;
Expand All @@ -362,6 +364,8 @@ public static void ResetAndDisableAggro(Entity familiar)
if (ServerGameManager.TryGetBuffer<AggroBuffer>(familiar, out var aggroBuffer)) aggroBuffer.Clear();
*/

if (!familiar.Has<AggroConsumer>()) return;

familiar.With((ref AggroConsumer aggroConsumer) =>
{
aggroConsumer.Active._Value = false;
Expand Down

0 comments on commit a68963a

Please sign in to comment.