Skip to content

Commit

Permalink
Fix quest manager updating records unnecessarily during update mob kills
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaioru committed Sep 24, 2023
1 parent 8307727 commit 12af876
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,17 @@ public async Task UpdateMobKill(IFieldUser user, int mobID, int inc)
var checkMob = quest.CheckEnd.CheckMob.FirstOrDefault(m => m.MobID == mobID);
if (checkMob == null) continue;

var count = Convert.ToInt32(builder.ToString(3 * checkMob.Order, 3)) + inc;
var count = Convert.ToInt32(builder.ToString(3 * checkMob.Order, 3));

if (count >= checkMob.Count) continue;

count += inc;
count = Math.Min(count, checkMob.Count);
count = Math.Max(count, 0);

builder.Remove(3 * checkMob.Order, 3);
builder.Insert(3 * checkMob.Order, count.ToString("000"));

record.Value = builder.ToString();
_ = user.Message(new QuestRecordAcceptMessage(questID, record.Value));
}
Expand Down

0 comments on commit 12af876

Please sign in to comment.