summaryrefslogtreecommitdiff
path: root/src/being.h
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-10-04 11:32:15 +0200
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-10-08 21:03:44 +0200
commit573df67919ec5f65a6b2ad51ed8aed31c9cfe4a6 (patch)
treee50500d452fdb3a503d3257477facc38017f7e10 /src/being.h
parent7de0b165f196cb0c1f983b6d2ab26ef9791a2d36 (diff)
downloadmana-573df67919ec5f65a6b2ad51ed8aed31c9cfe4a6.tar.gz
mana-573df67919ec5f65a6b2ad51ed8aed31c9cfe4a6.tar.bz2
mana-573df67919ec5f65a6b2ad51ed8aed31c9cfe4a6.tar.xz
mana-573df67919ec5f65a6b2ad51ed8aed31c9cfe4a6.zip
Smoother being movement
There was a slight stutter in being movement, since each time a being reached the next position along its path, it would only continue to the following position with the next logic tick. Now the logic has been adjusted to keep moving until all the time for the current frame was used up, or the path was exhausted. A slight stutter remains for keyboard movement, as well as broken walk animation playback, since it will only set a new path once the current one is finished (see e554d9b2be1ec2fcb15065ae70151302adeef602). Also simplified some logic in Viewport::draw and removed some obsolete code in LocalPlayer::startWalking.
Diffstat (limited to 'src/being.h')
-rw-r--r--src/being.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/being.h b/src/being.h
index 5c939fcc..8f596810 100644
--- a/src/being.h
+++ b/src/being.h
@@ -319,14 +319,7 @@ class Being : public ActorSprite, public EventListener
* in ticks per tile for eAthena,
* in tiles per second for Manaserv (0.1 precision).
*/
- virtual void setMoveSpeed(const Vector &speed);
-
- /**
- * Gets the original Move speed.
- * in ticks per tile for eAthena,
- * in tiles per second for Manaserv (0.1 precision).
- */
- Vector getMoveSpeed() const { return mMoveSpeed; }
+ void setMoveSpeed(const Vector &speed);
/**
* Sets the attack speed.
@@ -530,6 +523,7 @@ class Being : public ActorSprite, public EventListener
bool mIsGM = false;
private:
+ void updateMovement();
const Type mType;
@@ -539,7 +533,7 @@ class Being : public ActorSprite, public EventListener
/**
* Walk speed for x and y movement values.
* In ticks per tile for eAthena,
- * In pixels per second for Manaserv.
+ * In tiles per second for Manaserv.
*/
Vector mMoveSpeed;