fix problem with TimedModifier using RPC on every client, despite being replicated

This commit is contained in:
XtraCube committed 2024-09-02 12:57:25 -04:00
1 parent 97ded2fc32
commit 3cada4cb3d
3 files changed
+7 -1

No files matched your search

+5
View File
@@ -10,6 +10,11 @@ public abstract class BaseModifier
/// </summary>
public PlayerControl? Player { get; internal set; }
/// <summary>
/// Gets the modifier component that the modifier is attached to.
/// </summary>
public ModifierComponent? ModifierComponent { get; internal set; }
/// <summary>
/// Gets the modifier id.
/// </summary>
+1
View File
@@ -213,6 +213,7 @@ public class ModifierComponent(IntPtr ptr) : MonoBehaviour(ptr)
_toAdd.Add(modifier);
modifier.Player = _player;
modifier.ModifierComponent = this;
modifier.ModifierId = modifierId.Value;
return modifier;
}
+1 -1
View File
@@ -71,7 +71,7 @@ public abstract class TimedModifier : BaseModifier
if (RemoveOnComplete)
{
Player?.RpcRemoveModifier(ModifierId);
ModifierComponent?.RemoveModifier(ModifierId);
}
}
}