summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChuck Miller <shadowmil@gmail.com>2010-03-30 16:41:54 -0400
committerChuck Miller <shadowmil@gmail.com>2010-03-30 16:41:54 -0400
commit9bbdb6c110720f6b7c738fa165e3fc478b7ebf34 (patch)
treed8f5d0d6549543df01516a8577b8fbff8a057107 /src
parent30a7e00021aa420e8eea46c439c6dfbd1b54bbac (diff)
downloadmanaserv-9bbdb6c110720f6b7c738fa165e3fc478b7ebf34.tar.gz
manaserv-9bbdb6c110720f6b7c738fa165e3fc478b7ebf34.tar.xz
manaserv-9bbdb6c110720f6b7c738fa165e3fc478b7ebf34.zip
Fix sitting and standing
Diffstat (limited to 'src')
-rw-r--r--src/game-server/being.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/game-server/being.cpp b/src/game-server/being.cpp
index d1d4afe..20b4fea 100644
--- a/src/game-server/being.cpp
+++ b/src/game-server/being.cpp
@@ -180,6 +180,8 @@ void Being::move()
int tileDX = mDst.x / 32, tileDY = mDst.y / 32;
if (tileSX == tileDX && tileSY == tileDY)
{
+ if (mAction == WALK)
+ setAction(STAND);
// Moving while staying on the same tile is free
setPosition(mDst);
mActionTime = 0;
@@ -214,12 +216,16 @@ void Being::move()
if (mPath.empty())
{
+ if (mAction == WALK)
+ setAction(STAND);
// no path was found
mDst = mOld;
mActionTime = 0;
return;
}
+ setAction(WALK);
+
Position prev(tileSX, tileSY);
Point pos;
do
@@ -243,11 +249,6 @@ void Being::move()
setPosition(pos);
mActionTime = mActionTime > 100 ? mActionTime - 100 : 0;
-
- if (mAction == WALK || mAction == STAND)
- {
- mAction = (mActionTime) ? WALK : STAND;
- }
}
int Being::directionToAngle(int direction)