Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FaloopIntegration] Fix ActiveMobUi death function not being called. #670

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions FaloopIntegration/FaloopIntegration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,10 @@ private void OnMobReport(MobReportData data)
OnMobFalseSpawn(ev);
break;
}
case MobReportActions.Death when config.EnableDeathReport:
case MobReportActions.Death:
var death = JsonSerializer.Deserialize<MobReportData.Death>(data.Data) ?? throw new InvalidOperationException("invalid death data");
OnMobDeath(new MobDeathEvent(mobData.BNpcId, worldId, data.Ids.ZoneInstance, mobData.Rank, death.StartedAt), config.Channel, config.SkipOrphanReport);
OnMobDeath(new MobDeathEvent(mobData.BNpcId, worldId, data.Ids.ZoneInstance, mobData.Rank, death.StartedAt),
config.Channel, config.SkipOrphanReport, config.EnableDeathReport);
DalamudLog.Log.Verbose("OnMobReport: OnDeathMobReport");
break;
}
Expand Down Expand Up @@ -288,7 +289,7 @@ private void OnMobFalseSpawn(MobDeathEvent ev)
spawnEvents.RemoveAll(x => x.Id == ev.Id);
}

private void OnMobDeath(MobDeathEvent ev, int channel, bool skipOrphanReport)
private void OnMobDeath(MobDeathEvent ev, int channel, bool skipOrphanReport, bool enableDeathReport)
{
Ui.OnMobDeath(ev);

Expand All @@ -298,6 +299,11 @@ private void OnMobDeath(MobDeathEvent ev, int channel, bool skipOrphanReport)
return;
}

if (!enableDeathReport)
{
return;
}

var payloads = new List<Payload>();
if (Config.EnableSimpleReports)
{
Expand Down