slayer plugin: fix unknown tasks not decrementing counter

This commit is contained in:
Alexsuperfly
2019-08-19 12:47:33 -04:00
committed by Adam
parent c8ffa3994d
commit dea4972c00
2 changed files with 49 additions and 6 deletions

View File

@@ -537,12 +537,9 @@ public class SlayerPlugin extends Plugin
final Task task = Task.getTask(taskName);
if (task == null)
{
return;
}
final int taskKillExp = task.getExpectedKillExp();
// null tasks are technically valid, it only means they arent explicitly defined in the Task enum
// allow them through so that if there is a task capture failure the counter will still work
final int taskKillExp = task != null ? task.getExpectedKillExp() : 0;
// 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.