0
0
Fork 0
mirror of https://github.com/Sanae6/SmoOnlineServer.git synced 2024-11-22 03:05:16 +00:00

Clear global shine bag on new speedrun

This commit is contained in:
Sanae 2022-03-31 15:34:08 -06:00
parent b3686e8197
commit 6224234272

View file

@ -82,10 +82,10 @@ server.PacketHandler = (c, p) => {
switch (gamePacket.Stage) {
case "CapWorldHomeStage" when gamePacket.ScenarioNum == 0:
c.Metadata["speedrun"] = true;
ConcurrentBag<int> clientBag = (ConcurrentBag<int>) (c.Metadata["shineSync"] ??= new ConcurrentBag<int>());
clientBag.Clear();
((ConcurrentBag<int>) (c.Metadata["shineSync"] ??= new ConcurrentBag<int>())).Clear();
shineBag.Clear();
break;
case "WaterfallWorldHomeStage" when gamePacket.ScenarioNum >= 0:
case "WaterfallWorldHomeStage":
bool wasSpeedrun = (bool) c.Metadata["speedrun"]!;
c.Metadata["speedrun"] = false;
if (wasSpeedrun)