project(mixins): Always try to grab a widget

This commit is contained in:
Owain van Brakel
2022-04-21 10:42:43 +02:00
parent adc5479027
commit 8b6aafef68

View File

@@ -65,23 +65,26 @@ public abstract class RuneLiteMenuEntryMixin implements RSRuneLiteMenuEntry
@Override @Override
public Widget getWidget() public Widget getWidget()
{ {
MenuAction menuAction = this.getType(); int param1 = this.getParam1();
if (menuAction == MenuAction.CC_OP || menuAction == MenuAction.CC_OP_LOW_PRIORITY) int param0 = this.getParam0();
{
int param1 = this.getParam1();
int param0 = this.getParam0();
if (param1 == 9764864)
{
Widget widget = client.getWidget(param1);
if (param0 != -1)
{
widget = widget.getChild(param0);
}
return widget; Widget widget = client.getWidget(param1);
if (widget == null)
{
return null;
}
if (param0 != -1)
{
Widget child = widget.getChild(param0);
if (child != null)
{
return child;
} }
} }
return null; return widget;
} }
} }