mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 21:35:49 +00:00
add check to prevent adding modifiers before a game has started
This commit is contained in:
1 parent
7e4a71739c
commit
0e2eeea069
1 file changed
+6
@@ -366,6 +366,12 @@ public class ModifierComponent(IntPtr cppPtr) : MonoBehaviour(cppPtr)
|
||||
[HideFromIl2Cpp]
|
||||
public BaseModifier? AddModifier(BaseModifier modifier)
|
||||
{
|
||||
if (!AmongUsClient.Instance.IsGameStarted)
|
||||
{
|
||||
Logger<MiraApiPlugin>.Error("Cannot add modifier because the game has not started yet.");
|
||||
return null;
|
||||
}
|
||||
|
||||
var id = modifier.TypeId;
|
||||
if (modifier.Unique && Modifiers.Find(x => x.TypeId == id) != null)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user