mixins: make good mixin

This commit is contained in:
ThatGamerBlue
2021-03-24 20:29:34 +00:00
parent ea04edba2b
commit 24d211b7a5

View File

@@ -56,7 +56,19 @@ public abstract class RSTileObjectMixin implements TileObject
@Inject
public WorldPoint getWorldLocation()
{
return WorldPoint.fromLocal(client, getX(), getY(), getPlane());
if (this instanceof RSGameObject)
{
RSGameObject gameObject = (RSGameObject) this;
int startX = gameObject.getStartX();
int startY = gameObject.getStartY();
int diffX = gameObject.getEndX() - startX;
int diffY = gameObject.getEndY() - startY;
return WorldPoint.fromScene(client, startX + diffX / 2, startY + diffY / 2, getPlane());
}
else
{
return WorldPoint.fromLocal(client, getX(), getY(), getPlane());
}
}
@Override