mixins: Correct DecorativeObject's clickbox

- getOrientation has nothing to do with getClickbox's orientation parameter
- model A is offset by x/yOffset
- model B exists sometimes
This commit is contained in:
Max Weber
2019-05-12 23:59:03 -06:00
parent feb2454e55
commit f2935dcfdb

View File

@@ -110,7 +110,29 @@ public abstract class RSDecorativeObjectMixin implements RSDecorativeObject
@Override
public Area getClickbox()
{
return Perspective.getClickbox(client, getModel(), getOrientation(), getLocalLocation());
Area clickbox = new Area();
LocalPoint lp = getLocalLocation();
Area clickboxA = Perspective.getClickbox(client, getModel(), 0,
new LocalPoint(lp.getX() + getXOffset(), lp.getY() + getYOffset()));
Area clickboxB = Perspective.getClickbox(client, getModel2(), 0, lp);
if (clickboxA == null && clickboxB == null)
{
return null;
}
if (clickboxA != null)
{
clickbox.add(clickboxA);
}
if (clickboxB != null)
{
clickbox.add(clickboxB);
}
return clickbox;
}
@Inject