Merge branch 'pr/7' into quest

This commit is contained in:
Kyle Eldridge
2019-07-29 09:54:56 +01:00
2 changed files with 10 additions and 1 deletions

View File

@@ -738,7 +738,14 @@ public class SlayerPlugin extends Plugin
if (cachedXp != 0)
{
final int taskKillExp = Task.getTask(taskName).getExpectedKillExp();
final Task task = Task.getTask(taskName);
if (task == null)
{
return;
}
final int taskKillExp = task.getExpectedKillExp();
// Only count exp gain as a kill if the task either has no expected exp for a kill, or if the exp gain is equal
// to the expected exp gain for the task.

View File

@@ -33,6 +33,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
import lombok.AccessLevel;
import javax.annotation.Nullable;
import lombok.Getter;
import net.runelite.api.ItemID;
import net.runelite.api.NpcID;
@@ -355,6 +356,7 @@ enum Task
this.expectedKillExp = 0;
}
@Nullable
static Task getTask(String taskName)
{
return tasks.get(taskName.toLowerCase());