mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
fix problem with TimedModifier using RPC on every client, despite being replicated
This commit is contained in:
1 parent
97ded2fc32
commit
3cada4cb3d
3 files changed
+7
-1
No files matched your search
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public abstract class TimedModifier : BaseModifier
|
||||
|
||||
if (RemoveOnComplete)
|
||||
{
|
||||
Player?.RpcRemoveModifier(ModifierId);
|
||||
ModifierComponent?.RemoveModifier(ModifierId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user