Skip to content

Commit

Permalink
Now it will compile in the page
Browse files Browse the repository at this point in the history
* Removing Else if (spawnPoint is RoleSpawnPoint roleSpawnPoint) since its not necessary spawnpoint.Position does the same.

* Supressing CS0618  due the obsolet in SpawnLocationType.InsideLocker.
   * Note: SpawnLocationType.InsideLocker its only used in CustomItem.SpawnAll() so it will be fine to deleted this in futures releases.

* Fixing compile action due the warnings
  • Loading branch information
SrLicht committed Aug 26, 2024
1 parent 2342dde commit 7e2d32e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions EXILED/Exiled.CustomItems/API/Features/CustomItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ public virtual uint Spawn(IEnumerable<SpawnPoint> spawnPoints, uint limit)

spawned++;

#pragma warning disable CS0618 // Type or member is obsolete \\ TODO: REMOVE THIS
if (spawnPoint is DynamicSpawnPoint dynamicSpawnPoint && dynamicSpawnPoint.Location == SpawnLocationType.InsideLocker)
{
for (int i = 0; i < 50; i++)
Expand Down Expand Up @@ -666,10 +667,6 @@ public virtual uint Spawn(IEnumerable<SpawnPoint> spawnPoints, uint limit)
break;
}
}
else if (spawnPoint is RoleSpawnPoint roleSpawnPoint)
{
Spawn(roleSpawnPoint.Role.GetRandomSpawnLocation().Position, null);
}
else
{
Pickup? pickup = Spawn(spawnPoint.Position, null);
Expand All @@ -681,6 +678,7 @@ public virtual uint Spawn(IEnumerable<SpawnPoint> spawnPoints, uint limit)

Log.Debug($"Spawned {Name} at {spawnPoint.Position} ({spawnPoint.Name})");
}
#pragma warning restore CS0618 // Type or member is obsolete
}

return spawned;
Expand Down Expand Up @@ -708,7 +706,7 @@ public virtual void SpawnAll()
// spawned += Spawn(SpawnProperties.LockerSpawnPoints, SpawnProperties.Limit - spawned);
// if (spawned < SpawnProperties.Limit)
// Spawn(SpawnProperties.StaticSpawnPoints, SpawnProperties.Limit - spawned);
Spawn(SpawnProperties.StaticSpawnPoints, Math.Min(SpawnProperties.Limit, SpawnProperties.Limit - Math.Min(Spawn(SpawnProperties.DynamicSpawnPoints, SpawnProperties.Limit), SpawnProperties.Limit - Math.Min(Spawn(SpawnProperties.RoleSpawnPoints, SpawnProperties.Limit), SpawnProperties.Limit - Math.Min(Spawn(SpawnProperties.RoomSpawnPoints, SpawnProperties.Limit),SpawnProperties.Limit - Spawn(SpawnProperties.LockerSpawnPoints, SpawnProperties.Limit))))));
Spawn(SpawnProperties.StaticSpawnPoints, Math.Min(SpawnProperties.Limit, SpawnProperties.Limit - Math.Min(Spawn(SpawnProperties.DynamicSpawnPoints, SpawnProperties.Limit), SpawnProperties.Limit - Math.Min(Spawn(SpawnProperties.RoleSpawnPoints, SpawnProperties.Limit), SpawnProperties.Limit - Math.Min(Spawn(SpawnProperties.RoomSpawnPoints, SpawnProperties.Limit), SpawnProperties.Limit - Spawn(SpawnProperties.LockerSpawnPoints, SpawnProperties.Limit))))));
}

/// <summary>
Expand Down

0 comments on commit 7e2d32e

Please sign in to comment.