Skip to content

Commit

Permalink
Merge pull request #32 from EliphasNUIT/master
Browse files Browse the repository at this point in the history
Fix for the issue #31
  • Loading branch information
baaron4 authored Jun 11, 2018
2 parents bccda3d + 8ad019a commit 6179187
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions LuckParser/Controllers/Controller1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3471,10 +3471,10 @@ private void CreateDeathRecap(StreamWriter sw, Player p)
List<DamageLog> damageLogs = p.getDamageTakenLogs(b_data, c_data.getCombatList(), getAgentData(), getMechData());
SkillData s_data = getSkillData();
List<SkillItem> s_list = s_data.getSkillList();
List<Point> down = getCombatData().getStates(p.getInstid(), "CHANGE_DOWN");
List<Point> down = getCombatData().getStates(p.getInstid(), "CHANGE_DOWN", b_data.getFirstAware(), b_data.getLastAware());
if (down.Count > 0)
{
List<Point> ups = getCombatData().getStates(p.getInstid(), "CHANGE_UP");
List<Point> ups = getCombatData().getStates(p.getInstid(), "CHANGE_UP", b_data.getFirstAware(), b_data.getLastAware());
down = down.GetRange(ups.Count(), down.Count()-ups.Count());
}
List<Point> dead = getCombatData().getStates(p.getInstid(), "CHANGE_DEAD");
Expand Down
5 changes: 3 additions & 2 deletions LuckParser/Models/ParseModels/CombatData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ public void addItem(CombatItem item)
combat_list.Add(item);
}

public List<Point> getStates(int src_instid, String change)
public List<Point> getStates(int src_instid, String change, long start = 0, long end = 0)
{
List<Point> states = new List<Point>();
foreach (CombatItem c in combat_list)
List<CombatItem> li = (end - start) > 0 ? combat_list.Where(x => x.getTime() >= 0 && x.getTime() < end).ToList() : combat_list;
foreach (CombatItem c in li)
{
if (c.getSrcInstid() == src_instid && c.isStateChange().getEnum() == change)
{
Expand Down

0 comments on commit 6179187

Please sign in to comment.