From c25647a73b887ed2d13ee94fe562510f592fe7a1 Mon Sep 17 00:00:00 2001 From: TheRealKamisama <35005476+TheRealKamisama@users.noreply.github.com> Date: Tue, 2 Apr 2024 00:50:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=91=E6=80=8E=E4=B9=88=E6=84=9F=E8=A7=89?= =?UTF-8?q?=E5=A5=BD=E5=83=8F=E5=BA=94=E8=AF=A5=E6=98=AF=E8=BF=99=E6=A0=B7?= =?UTF-8?q?=E6=89=8D=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WFBot/Features/Common/WFNotificationHandler.cs | 8 +++++--- WFBot/Features/Utils/WFObjects.cs | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/WFBot/Features/Common/WFNotificationHandler.cs b/WFBot/Features/Common/WFNotificationHandler.cs index f05bcad..f53bd41 100644 --- a/WFBot/Features/Common/WFNotificationHandler.cs +++ b/WFBot/Features/Common/WFNotificationHandler.cs @@ -290,11 +290,13 @@ private void CheckInvasions() private static IEnumerable GetAllInvasionsCountedItems(WFInvasion inv) { - foreach (var reward in inv.Attacker.Reward.countedItems) + if (!inv.vsInfestation) { - yield return reward.Type; + foreach (var reward in inv.Attacker.Reward.countedItems) + { + yield return reward.Type; + } } - foreach (var reward in inv.Defender.Reward.countedItems) { yield return reward.Type; diff --git a/WFBot/Features/Utils/WFObjects.cs b/WFBot/Features/Utils/WFObjects.cs index 310bf36..611de2b 100644 --- a/WFBot/Features/Utils/WFObjects.cs +++ b/WFBot/Features/Utils/WFObjects.cs @@ -1782,12 +1782,12 @@ public class WFInvasion } public class Attacker { + [JsonProperty("reward")] - private RewardInfo reward1; public RewardInfo Reward { - get => reward1 ?? new RewardInfo(); - set => reward1 = value; + get; + set; } [JsonProperty("faction")]