Skip to content

Commit

Permalink
Fix improper handling of reference votes under partition by task.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinematics committed Jun 16, 2015
1 parent 57d2c8f commit a54971b
Showing 1 changed file with 33 additions and 9 deletions.
42 changes: 33 additions & 9 deletions TallyCore/VoteConstructor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -373,17 +373,41 @@ private void PartitionReferrals(List<string> partitions, StringBuilder sb, List<
}
else if (quest.PartitionMode == PartitionMode.ByTask)
{
string firstLine = referralVotes.First();
string task = VoteLine.GetVoteTask(firstLine);
if (task != string.Empty)
foreach (var v in referralVotes)
{
currentTask = task;
if (VoteLine.GetVoteContent(firstLine) == string.Empty)
taskHeader = firstLine;
}
string task = VoteLine.GetVoteTask(v);
if (task == string.Empty)
{
// If there is no task associated with the referral element,
// treat it like PartitionMode.None.
sb.Append(v);
}
else
{
// If there is a task, store any existing sb values in the
// partitions, and add the referral as a partition.
if (sb.Length > 0)
{
partitions.Add(sb.ToString());
sb.Clear();
}

foreach (var v in referralVotes)
sb.Append(v);
currentTask = task;

string firstLine = Utility.Text.FirstLine(v);
string firstLineContent = VoteLine.GetVoteContentFirstLine(v);
if (firstLineContent == string.Empty)
{
taskHeader = firstLine;
}
else
{
taskHeader = "";
}

partitions.Add(v);
}
}
}
else
{
Expand Down

0 comments on commit a54971b

Please sign in to comment.