Skip to content

Commit a993932

Browse files
feat: don't show placed code message when in streamer mode
1 parent 4d70a59 commit a993932

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

src/AutoCode.cs

+20-12
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,16 @@ void OnEntitySpawned(CodeLock codeLock)
127127
// Lock the lock.
128128
codeLock.SetFlag(BaseEntity.Flags.Locked, true);
129129

130-
player.ChatMessage(
131-
string.Format(
132-
lang.GetMessage("CodeAutoLocked", this, player.UserIDString),
133-
player.net.connection.info.GetBool("global.streamermode") ? "****" : settings.code
134-
)
135-
);
130+
// Don't display code if in streamer mode.
131+
if (!player.net.connection.info.GetBool("global.streamermode"))
132+
{
133+
player.ChatMessage(
134+
string.Format(
135+
lang.GetMessage("CodeAutoLocked", this, player.UserIDString),
136+
settings.code
137+
)
138+
);
139+
}
136140
}
137141

138142
object CanUseLockedEntity(BasePlayer player, CodeLock codeLock)
@@ -293,12 +297,16 @@ public void SetCode(BasePlayer player, string code, bool guest = false)
293297

294298
settings.lastSet = currentTime;
295299

296-
player.ChatMessage(
297-
string.Format(
298-
lang.GetMessage(guest ? "GuestCodeUpdated" : "CodeUpdated", this, player.UserIDString),
299-
player.net.connection.info.GetBool("global.streamermode") ? "****" : code
300-
)
301-
);
300+
// Don't display code if in streamer mode.
301+
if (!player.net.connection.info.GetBool("global.streamermode"))
302+
{
303+
player.ChatMessage(
304+
string.Format(
305+
lang.GetMessage(guest ? "GuestCodeUpdated" : "CodeUpdated", this, player.UserIDString),
306+
code
307+
)
308+
);
309+
}
302310
}
303311

304312
/// <summary>

0 commit comments

Comments
 (0)