Merge pull request #11972 from Nightfirecat/slayer-plugin-use-higher-of-task-lengths-for-start
slayer: Update initial amount if current amount is higher
This commit is contained in:
@@ -730,7 +730,7 @@ public class SlayerPlugin extends Plugin
|
||||
{
|
||||
taskName = name;
|
||||
amount = amt;
|
||||
initialAmount = initAmt;
|
||||
initialAmount = Math.max(amt, initAmt);
|
||||
taskLocation = location;
|
||||
save();
|
||||
removeCounter();
|
||||
|
||||
@@ -781,6 +781,17 @@ public class SlayerPluginTest
|
||||
assertEquals(30, slayerPlugin.getAmount());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateInitialAmount()
|
||||
{
|
||||
Widget npcDialog = mock(Widget.class);
|
||||
when(npcDialog.getText()).thenReturn(TASK_EXISTING);
|
||||
when(client.getWidget(WidgetInfo.DIALOG_NPC_TEXT)).thenReturn(npcDialog);
|
||||
slayerPlugin.onGameTick(new GameTick());
|
||||
|
||||
assertEquals(222, slayerPlugin.getInitialAmount());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTaskLookup() throws IOException
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user