Skip to content

Commit 2b20944

Browse files
committed
Preparing for v2.0.0
1 parent 463e418 commit 2b20944

5 files changed

Lines changed: 8 additions & 15 deletions

File tree

UncomplicatedCustomTeams/EventHandlers/SpawnWaves/TeamDependent.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ private void TrySpawnDependentTeams(uint triggerTeamId, bool isDeathTrigger)
5151

5252
private void SpawnTeam(Team team)
5353
{
54-
Timing.CallDelayed(team.SpawnConditions.SpawnDelay, () =>
54+
CoroutineHandle handle = Timing.CallDelayed(team.SpawnConditions.SpawnDelay, () =>
5555
{
5656
var spawned = TeamSpawner.SpawnSpecificTeam(team);
5757

@@ -64,6 +64,7 @@ private void SpawnTeam(Team team)
6464
LogManager.Warn($"Dependent Team '{team.Name}' failed to spawn.");
6565
}
6666
});
67+
Plugin.Singleton.Handler.ActiveSpawnDelays.Add(handle);
6768
}
6869
}
6970
}

UncomplicatedCustomTeams/EventHandlers/SpawnWaves/UsedItem.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,15 @@ public void OnItemUsed(PlayerUsedItemEventArgs ev)
4646

4747
LogManager.Debug($"Item '{ev.UsableItem.Type}' matches team '{teamToSpawn.Name}' and passed RNG.");
4848

49-
Timing.CallDelayed(teamToSpawn.SpawnConditions.SpawnDelay, () =>
49+
CoroutineHandle handle = Timing.CallDelayed(teamToSpawn.SpawnConditions.SpawnDelay, () =>
5050
{
5151
var spawnedTeam = TeamSpawner.SpawnSpecificTeam(teamToSpawn);
5252
if (spawnedTeam != null)
5353
{
5454
LogManager.Debug($"Team with 'UsedItem' Spawn Wave spawned successfully: {teamToSpawn.Name}");
5555
}
5656
});
57+
Plugin.Singleton.Handler.ActiveSpawnDelays.Add(handle);
5758
}
5859
}
5960
}

UncomplicatedCustomTeams/Integrations/ECI.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ public static bool IsCustomItem(ushort itemSerial, int id)
7171

7272
if (customItemInstance == null) return false;
7373

74-
IEnumerable serials = _trackedSerialsProp.GetValue(customItemInstance) as IEnumerable;
75-
if (serials == null) return false;
74+
if (_trackedSerialsProp.GetValue(customItemInstance) is not IEnumerable serials) return false;
7675

7776
foreach (var s in serials)
7877
{

UncomplicatedCustomTeams/Resources/DefaultConfig.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,3 @@ teams:
147147
spawn_settings:
148148
custom_flags:
149149
ignore_spawn_system: false
150-
ecr_roles:
151-
- max_players: 1
152-
priority: None
153-
drop_inventory_on_death: true
154-
is_godmode_enabled: false
155-
is_bypass_enabled: false
156-
is_noclip_enabled: false
157-
id: 1

UncomplicatedCustomTeams/Utilities/HttpManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ internal class HttpManager
4848
/// <summary>
4949
/// Gets the CreditTag storage for the plugin, downloaded from our central server
5050
/// </summary>
51-
public Dictionary<string, Triplet<string, string, bool>> Credits { get; internal set; } = new();
51+
public Dictionary<string, Triplet<string, string, bool>> Credits { get; internal set; } = [];
5252

5353
/// <summary>
5454
/// Gets the role of the given player (as steamid@64) inside UCT
5555
/// </summary>
56-
public List<string> IsJobRole { get; } = new();
56+
public List<string> IsJobRole { get; } = [];
5757

5858
/// <summary>
5959
/// Gets the latest <see cref="Version"/> of the plugin, loaded by the UCS cloud
@@ -113,7 +113,7 @@ public void LoadLatestVersion()
113113

114114
public void LoadCreditTags()
115115
{
116-
Credits = new();
116+
Credits = [];
117117
try
118118
{
119119
Dictionary<string, Dictionary<string, JsonElement>> Data = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, JsonElement>>>(HttpQuery.Get($"https://api.ucserver.it/credits.json"));

0 commit comments

Comments
 (0)