FINALLY FIX MEMORY LEAK OMG (+ improved the lobby settings UI overall)

This commit is contained in:
Gurge44 committed 2026-06-10 15:30:05 +02:00
1 parent 3bb0758e55
commit bccb216e2d
29 files changed
+365 -557

No files matched your search

+2
View File
@@ -326,6 +326,8 @@ public static class CaptureTheFlag
if (pc && outfit != null)
Utils.RpcChangeSkin(pc, outfit);
}
DefaultOutfits = [];
}
}
+1 -1
View File
@@ -174,7 +174,7 @@ internal static class CustomHnS
}
}
Dictionary<Team, PlayerControl[]> playerTeams =Main.TeamValues[1..4]
Dictionary<Team, PlayerControl[]> playerTeams = Main.TeamValues[1..4]
.SelectMany(x => Enumerable.Repeat(x, Math.Max(memberNum[x], 0)))
.Shuffle()
.Zip(allPlayers)
+5 -1
View File
@@ -664,7 +664,11 @@ public static class KingOfTheZones
}
}
void ResetSkins() => DefaultOutfits.Select(x => (pc: x.Key.GetPlayer(), outfit: x.Value)).DoIf(x => x.pc && x.outfit != null, x => Utils.RpcChangeSkin(x.pc, x.outfit));
void ResetSkins()
{
DefaultOutfits.Select(x => (pc: x.Key.GetPlayer(), outfit: x.Value)).DoIf(x => x.pc && x.outfit != null, x => Utils.RpcChangeSkin(x.pc, x.outfit));
DefaultOutfits = [];
}
}
public static bool IsNotInLocalPlayersTeam(PlayerControl pc)
+1 -2
View File
@@ -14,7 +14,6 @@ public static class TheMindGame
{
private static Dictionary<byte, int> Points = [];
private static Dictionary<byte, int> SuperPoints = [];
private static Dictionary<PlayerControl, int> DefaultColorIds = [];
private static Dictionary<byte, Group> Groups = [];
private static Dictionary<Group, List<byte>> GroupPlayers = [];
private static List<SystemTypes> AllRooms = [];
@@ -276,7 +275,7 @@ public static class TheMindGame
var pcCount = aapc.Count;
Points = aapc.ToDictionary(x => x.PlayerId, _ => 0);
SuperPoints = aapc.ToDictionary(x => x.PlayerId, _ => 0);
DefaultColorIds = aapc.ToDictionary(x => x, x => x.Data.DefaultOutfit.ColorId);
aapc.ToDictionary(x => x, x => x.Data.DefaultOutfit.ColorId);
PlayerItems = aapc.ToDictionary(x => x.PlayerId, _ => new List<Item>());
Groups = [];