Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Plank Sack] Mahogany homes repair bug fix #112

Open
wants to merge 2 commits into
base: plank-sack
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repositories {
mavenCentral()
}

def runeLiteVersion = '1.9.13.1'
def runeLiteVersion = 'latest.release'

dependencies {
compileOnly group: 'net.runelite', name:'client', version: runeLiteVersion
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/io/hydrox/planksack/PlankSackPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ PlankSackConfig getConfig(ConfigManager configManager)
private final List<BuildMenuItem> buildMenuItems = new ArrayList<>();

private boolean watchForAnimations = false;
private boolean ignoreAnimation = false;
private int lastAnimation = -1;

@Override
Expand Down Expand Up @@ -241,7 +242,8 @@ else if (event.getMenuOption().equals("Use")
}
}
}
else if (event.getMenuOption().equals("Repair") && MAHOGANY_HOMES_REPAIRS.contains(event.getId()))
else if (!ignoreAnimation
&& event.getMenuOption().equals("Repair") && MAHOGANY_HOMES_REPAIRS.contains(event.getId()))
{
watchForAnimations = true;
inventorySnapshot = createSnapshot(client.getItemContainer(InventoryID.INVENTORY));
Expand All @@ -262,6 +264,7 @@ public void onScriptPreFired(ScriptPreFired event)
{
return;
}
ignoreAnimation = true;

Widget widget = event.getScriptEvent().getSource();
int idx = WidgetInfo.TO_CHILD(widget.getId()) - CONSTRUCTION_WIDGET_BUILD_IDX_START;
Expand Down Expand Up @@ -355,6 +358,9 @@ public void onGameTick(GameTick event)
@Subscribe
public void onAnimationChanged(AnimationChanged event)
{
if (ignoreAnimation){
ignoreAnimation = false;
}
if (!watchForAnimations || event.getActor() != client.getLocalPlayer() || client.getLocalPlayer() == null)
{
return;
Expand Down