fix ActivityContentManager

This commit is contained in:
2024-11-23 08:50:38 +01:00
parent 83d705c4c6
commit ca28a9d6f7

View File

@@ -40,31 +40,40 @@ public class ActivityContextManager : IDisposable
ActivityType newActivityContext;
ZoneType newZoneType;
if (content.PvP)
if (content.RowId == 0)
{
newActivityContext = ActivityType.PvpDuty;
newZoneType = ZoneType.Pvp;
// No content found, so we must be on the overworld
newActivityContext = ActivityType.None;
newZoneType = ZoneType.Overworld;
}
else
{
newActivityContext = ActivityType.PveDuty;
// Find correct member type
var memberType = content.ContentMemberType.RowId;
if (content.RowId == 16 || content.RowId == 15)
memberType = 2; // Praetorium and Castrum Meridianum
else if (content.RowId == 735 || content.RowId == 778)
memberType = 127; // Bozja
// Check for ZoneType
newZoneType = memberType switch
if (content.PvP)
{
2 => ZoneType.Doungen,
3 => ZoneType.Raid,
4 => ZoneType.AllianceRaid,
127 => ZoneType.Foray,
_ => ZoneType.Doungen,
};
newActivityContext = ActivityType.PvpDuty;
newZoneType = ZoneType.Pvp;
}
else
{
newActivityContext = ActivityType.PveDuty;
// Find correct member type
var memberType = content.ContentMemberType.RowId;
if (content.RowId == 16 || content.RowId == 15)
memberType = 2; // Praetorium and Castrum Meridianum
else if (content.RowId == 735 || content.RowId == 778)
memberType = 127; // Bozja
// Check for ZoneType
newZoneType = memberType switch
{
2 => ZoneType.Doungen,
3 => ZoneType.Raid,
4 => ZoneType.AllianceRaid,
127 => ZoneType.Foray,
_ => ZoneType.Doungen,
};
}
}
CurrentActivityContext = new(newActivityContext, newZoneType);