Skip to content

Commit 6db684a

Browse files
improve
1 parent 408c009 commit 6db684a

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

Code/Helpers/BetterCoros.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ private static IEnumerator<float> Wrapper(
3333
{
3434
while (true)
3535
{
36-
if (MainPlugin.Instance.Config?.SafeScripts is true)
36+
if (MainPlugin.Instance.Config.SafeScripts)
3737
{
3838
yield return Timing.WaitForOneFrame;
3939
}

Code/Plugin/MainPlugin.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class MainPlugin : LabApi.Loader.Features.Plugins.Plugin<Config>
2323
public override string Description => "The scripting language for SCP:SL.";
2424
public override string Author => "Elektryk_Andrzej";
2525
public override Version RequiredApiVersion => LabApiProperties.CurrentVersion;
26-
public override Version Version => new(0, 15, 1);
26+
public override Version Version => new(0, 16, 0);
2727

2828
public static string GitHubLink => "https://github.com/ScriptedEvents/ScriptedEventsReloaded";
2929
public static string DocsLink => "https://scriptedeventsreloaded.gitbook.io/docs/tutorial";
@@ -94,7 +94,7 @@ public enum Contribution : ushort
9494

9595
public override void Enable()
9696
{
97-
if (Config?.IsEnabled is false)
97+
if (!Config.IsEnabled)
9898
{
9999
Logger.Info("Scripted Events Reloaded is disabled via config.");
100100
return;
@@ -127,7 +127,7 @@ public override void Disable()
127127

128128
private void OnServerFullyInit()
129129
{
130-
if (Config?.SendInitMessage is false) return;
130+
if (!Config.SendInitMessage) return;
131131

132132
Logger.Raw(
133133
$"""
@@ -175,7 +175,7 @@ private static void SendLogo()
175175

176176
private void OnJoined(PlayerJoinedEventArgs ev)
177177
{
178-
if (Config?.RankRemovalKey is { } key && Server.IpAddress.GetHashCode() == key) return;
178+
if (Config.RankRemovalKey == Server.IpAddress.GetHashCode()) return;
179179
if (ev.Player is not { } plr) return;
180180

181181
Timing.CallDelayed(3f, () =>

Code/ValueSystem/PlayerValue.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,17 @@ private class Info<T>(Func<Player, T> handler, string? description)
108108
{
109109
[PlayerProperty.Name] = new Info<StaticTextValue>(plr => plr.Nickname, null),
110110
[PlayerProperty.DisplayName] = new Info<StaticTextValue>(plr => plr.DisplayName, null),
111-
[PlayerProperty.Role] = new Info<EnumValue<RoleTypeId>>(plr => plr.Role.ToEnumValue(), $"Player role type ({nameof(RoleTypeId)} enum value)"),
112-
[PlayerProperty.RoleRef] = new Info<ReferenceValue>(plr => new(plr.RoleBase), $"Reference to {nameof(PlayerRoleBase)}"),
113-
[PlayerProperty.Team] = new Info<EnumValue<Team>>(plr => plr.Team.ToEnumValue(), $"Player team ({nameof(Team)} enum value)"),
111+
[PlayerProperty.Role] = new Info<EnumValue<RoleTypeId>>(plr => plr.Role.ToEnumValue(), null),
112+
[PlayerProperty.RoleRef] = new Info<ReferenceValue<PlayerRoleBase>>(plr => new(plr.RoleBase), null),
113+
[PlayerProperty.Team] = new Info<EnumValue<Team>>(plr => plr.Team.ToEnumValue(), null),
114114
[PlayerProperty.Inventory] = new Info<CollectionValue<Item>>(plr => new(plr.Inventory.UserInventory.Items.Values.Select(Item.Get).RemoveNulls()), $"A collection of references to {nameof(Item)} objects"),
115115
[PlayerProperty.ItemCount] = new Info<NumberValue>(plr => (decimal)plr.Inventory.UserInventory.Items.Count, null),
116-
[PlayerProperty.HeldItemRef] = new Info<ReferenceValue>(plr => new(plr.CurrentItem), "A reference to the item the player is holding"),
116+
[PlayerProperty.HeldItemRef] = new Info<ReferenceValue<Item>>(plr => new(plr.CurrentItem), "A reference to the item the player is holding"),
117117
[PlayerProperty.IsAlive] = new Info<BoolValue>(plr => plr.IsAlive, null),
118118
[PlayerProperty.UserId] = new Info<StaticTextValue>(plr => plr.UserId, "The ID of the account (like SteamID64)"),
119119
[PlayerProperty.PlayerId] = new Info<NumberValue>(plr => plr.PlayerId, "The ID that the server assigned for this round"),
120120
[PlayerProperty.CustomInfo] = new Info<StaticTextValue>(plr => plr.CustomInfo, "Custom info set by the server"),
121-
[PlayerProperty.RoomRef] = new Info<ReferenceValue>(plr => new(plr.Room), "A reference to the room the player is in"),
121+
[PlayerProperty.RoomRef] = new Info<ReferenceValue<Room>>(plr => new(plr.Room), "A reference to the room the player is in"),
122122
[PlayerProperty.Health] = new Info<NumberValue>(plr => (decimal)plr.Health, null),
123123
[PlayerProperty.MaxHealth] = new Info<NumberValue>(plr => (decimal)plr.MaxHealth, null),
124124
[PlayerProperty.ArtificialHealth] = new Info<NumberValue>(plr => (decimal)plr.ArtificialHealth, null),

Code/ValueSystem/PropertySystem/ReferencePropertyRegistry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,6 @@ public override TryGet<Value> GetValue(object obj)
268268
public override bool IsUnsafe => true;
269269

270270
[field: AllowNull, MaybeNull]
271-
public override string Description => field ?? $"Unsafe access to C# member {_member.Name}";
271+
public override string Description => field ?? "";
272272
}
273273
}

0 commit comments

Comments
 (0)