Add Actor#isMoving

This commit is contained in:
Burak Inan
2021-02-17 00:48:03 +01:00
parent 3e3f4ac4b1
commit 66b464c510
3 changed files with 11 additions and 0 deletions

View File

@@ -290,4 +290,6 @@ public interface Actor extends Renderable, Locatable
* @return * @return
*/ */
boolean isDead(); boolean isDead();
boolean isMoving();
} }

View File

@@ -292,4 +292,10 @@ public abstract class RSActorMixin implements RSActor
event.setHitsplat(hitsplat); event.setHitsplat(hitsplat);
client.getCallbacks().post(event); client.getCallbacks().post(event);
} }
@Inject
@Override
public boolean isMoving() {
return getPathLength() > 0;
}
} }

View File

@@ -184,4 +184,7 @@ public interface RSActor extends RSRenderable, Actor
int getRunAnimation(); int getRunAnimation();
void setDead(boolean dead); void setDead(boolean dead);
@Import("pathLength")
int getPathLength();
} }