Merge pull request #7122 from Nightfirecat/xp-drop-highlight-persist-per-tick

experiencedrop: Maintain active prayer per tick
This commit is contained in:
Tomas Slusny
2019-01-02 17:20:32 +01:00
committed by GitHub

View File

@@ -66,6 +66,7 @@ public class XpDropPlugin extends Plugin
private boolean hasDropped = false; private boolean hasDropped = false;
private Skill lastSkill = null; private Skill lastSkill = null;
private Map<Skill, Integer> previousSkillExpTable = new EnumMap<>(Skill.class); private Map<Skill, Integer> previousSkillExpTable = new EnumMap<>(Skill.class);
private PrayerType currentTickPrayer;
@Provides @Provides
XpDropConfig provideConfig(ConfigManager configManager) XpDropConfig provideConfig(ConfigManager configManager)
@@ -133,7 +134,7 @@ public class XpDropPlugin extends Plugin
} }
} }
PrayerType prayer = getActivePrayerType(); PrayerType prayer = currentTickPrayer;
if (prayer == null) if (prayer == null)
{ {
resetTextColor(widget); resetTextColor(widget);
@@ -199,6 +200,8 @@ public class XpDropPlugin extends Plugin
@Subscribe @Subscribe
public void onGameTick(GameTick tick) public void onGameTick(GameTick tick)
{ {
currentTickPrayer = getActivePrayerType();
final int fakeTickDelay = config.fakeXpDropDelay(); final int fakeTickDelay = config.fakeXpDropDelay();
if (fakeTickDelay == 0 || lastSkill == null) if (fakeTickDelay == 0 || lastSkill == null)