Skip to content

Commit

Permalink
[FaloopIntegration] Fix ActiveMobUi death event not being called.
Browse files Browse the repository at this point in the history
  • Loading branch information
Diyagi committed Jul 8, 2024
1 parent c4117b6 commit 795f163
Showing 1 changed file with 9 additions and 3 deletions.
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,10 +289,15 @@ 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);

if (!enableDeathReport)
{
return;
}

if (skipOrphanReport && spawnEvents.RemoveAll(x => x.Id == ev.Id) == 0)
{
DalamudLog.Log.Debug("OnDeathMobReport: skipOrphanReport");
Expand Down

0 comments on commit 795f163

Please sign in to comment.