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; ActivityType newActivityContext;
ZoneType newZoneType; ZoneType newZoneType;
if (content.PvP) if (content.RowId == 0)
{ {
newActivityContext = ActivityType.PvpDuty; // No content found, so we must be on the overworld
newZoneType = ZoneType.Pvp; newActivityContext = ActivityType.None;
newZoneType = ZoneType.Overworld;
} }
else else
{ {
newActivityContext = ActivityType.PveDuty; if (content.PvP)
// 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, newActivityContext = ActivityType.PvpDuty;
3 => ZoneType.Raid, newZoneType = ZoneType.Pvp;
4 => ZoneType.AllianceRaid, }
127 => ZoneType.Foray, else
_ => ZoneType.Doungen, {
}; 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); CurrentActivityContext = new(newActivityContext, newZoneType);