Ensure the failed rtp gets removed from the list

This commit is contained in:
zontreck 2025-03-10 10:11:33 -07:00
parent 40f8eb4048
commit aad44f4c45
2 changed files with 11 additions and 2 deletions

View file

@ -149,6 +149,15 @@ public class RTPFactory
// Log the request
ChunkChecks.Add(chunk);
if (rtp.NumTriesRemaining <= 0)
{
// Send failure message to the player
ServerUtilities.SendMessageTo(rtp.player, Lang.Get($"{ServerUtilities.MOD_ID}:rtp-fail"));
// This check needs to be removed from the queue
RTPCache.Remove(rtp);
return; // We modified the list, so abort the loop.
}
}
}