Add proper flag handling on TransitionType

This commit is contained in:
Archangel
2025-12-19 14:26:15 +01:00
parent 1e323f8c24
commit 828df84ef3
2 changed files with 18 additions and 2 deletions
@@ -1,5 +1,6 @@
namespace SPTarkov.Server.Core.Models.Enums;
[Flags]
public enum TransitionType
{
NONE = 0,
@@ -93,6 +93,21 @@ public class LocationLifecycleService(
: playerProfile.CharacterData.ScavData.Skills.Common
);
var transitionType = TransitionType.NONE;
if (request.TransitionType is TransitionType flags)
{
if (flags.HasFlag(TransitionType.COMMON))
{
transitionType = TransitionType.COMMON;
}
if (flags.HasFlag(TransitionType.EVENT))
{
transitionType = TransitionType.EVENT;
}
}
// Raid is starting, adjust run times to reduce server load while player is in raid
RagfairConfig.RunIntervalSeconds = RagfairConfig.RunIntervalValues.InRaid;
HideoutConfig.RunIntervalSeconds = HideoutConfig.RunIntervalValues.InRaid;
@@ -104,7 +119,7 @@ public class LocationLifecycleService(
ServerSettings = databaseService.GetLocationServices(), // TODO - is this per map or global?
Profile = new ProfileInsuredItems { InsuredItems = playerProfile.CharacterData.PmcData.InsuredItems },
LocationLoot = GenerateLocationAndLoot(sessionId, request.Location, !request.ShouldSkipLootGeneration ?? true),
TransitionType = request.TransitionType,
TransitionType = transitionType,
Transition = new Transition
{
TransitionType = request.TransitionType,
@@ -128,7 +143,7 @@ public class LocationLifecycleService(
if (transitionData is not null)
{
logger.Success($"Player: {sessionId} is in transit to {request.Location}");
result.Transition.TransitionType = request.TransitionType;
result.Transition.TransitionType = transitionType;
result.Transition.TransitionRaidId = transitionData.TransitionRaidId;
result.Transition.TransitionCount += 1;