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;
|
taskName = name;
|
||||||
amount = amt;
|
amount = amt;
|
||||||
initialAmount = initAmt;
|
initialAmount = Math.max(amt, initAmt);
|
||||||
taskLocation = location;
|
taskLocation = location;
|
||||||
save();
|
save();
|
||||||
removeCounter();
|
removeCounter();
|
||||||
|
|||||||
@@ -781,6 +781,17 @@ public class SlayerPluginTest
|
|||||||
assertEquals(30, slayerPlugin.getAmount());
|
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
|
@Test
|
||||||
public void testTaskLookup() throws IOException
|
public void testTaskLookup() throws IOException
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user