Skip to content
This repository has been archived by the owner on Apr 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2494 from ThatGamerBlue/oprs-boosts-info
Browse files Browse the repository at this point in the history
boosts: fix statchanged event
  • Loading branch information
ThatGamerBlue authored Apr 9, 2020
2 parents 29d7ba2 + a001d1d commit b0a6b38
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1087,16 +1087,21 @@ public static void experiencedChanged(int idx)
@Inject
public static void boostedSkillLevelsChanged(int idx)
{
Skill[] skills = Skill.values();
if (idx == 0)
{
return;
}

if (idx >= 0 && idx < skills.length - 1)
int changedSkillIdx = idx - 1 & 31;
int skillIdx = client.getChangedSkillLevels()[changedSkillIdx];
Skill[] skills = Skill.values();
if (skillIdx >= 0 && skillIdx < skills.length - 1)
{
Skill updatedSkill = skills[idx];
StatChanged statChanged = new StatChanged(
updatedSkill,
client.getSkillExperience(updatedSkill),
client.getRealSkillLevel(updatedSkill),
client.getBoostedSkillLevel(updatedSkill)
skills[skillIdx],
client.getSkillExperiences()[skillIdx],
client.getRealSkillLevels()[skillIdx],
client.getBoostedSkillLevels()[skillIdx]
);
client.getCallbacks().post(StatChanged.class, statChanged);
}
Expand Down
3 changes: 3 additions & 0 deletions runescape-api/src/main/java/net/runelite/rs/api/RSClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -1164,4 +1164,7 @@ public interface RSClient extends RSGameShell, Client

@Import("draggedWidgetY")
int getDraggedWidgetY();

@Import("changedSkills")
int[] getChangedSkillLevels();
}

0 comments on commit b0a6b38

Please sign in to comment.