summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/defines.h2
-rw-r--r--src/game-server/character.cpp9
-rw-r--r--src/game-server/character.hpp5
-rw-r--r--src/game-server/state.cpp30
4 files changed, 6 insertions, 40 deletions
diff --git a/src/defines.h b/src/defines.h
index d281be13..a3a7e2f9 100644
--- a/src/defines.h
+++ b/src/defines.h
@@ -149,7 +149,7 @@ enum {
PGMSG_DIRECTION_CHANGE = 0x0272, // B Direction
GPMSG_BEING_DIR_CHANGE = 0x0273, // W being id, B direction
GPMSG_BEING_HEALTH_CHANGE = 0x0274, // W being id, W health
- GPMSG_BEINGS_MOVE = 0x0280, // { W being id, B flags [, C position, B speed] [, W*2 destination] }*
+ GPMSG_BEINGS_MOVE = 0x0280, // { W being id, B flags [, W*2 position, B speed] }*
GPMSG_ITEMS = 0x0281, // { W item id, W*2 position }*
PGMSG_ATTACK = 0x0290, // W being id
GPMSG_BEING_ATTACK = 0x0291, // W being id, B direction, B attacktype
diff --git a/src/game-server/character.cpp b/src/game-server/character.cpp
index 9d25e42e..88f9aec8 100644
--- a/src/game-server/character.cpp
+++ b/src/game-server/character.cpp
@@ -128,15 +128,6 @@ void Character::update()
Being::update();
}
-std::list<PATH_NODE> Character::findPath()
-{
- mOld = getPosition();
- int startX = mOld.x / 32, startY = mOld.y / 32;
- int destX = mDst.x / 32, destY = mDst.y / 32;
- Map *map = getMap()->getMap();
- return map->findSimplePath(startX, startY, destX, destY, getWalkMask());
-}
-
void Character::perform()
{
if (mAction != ATTACK || mTarget == NULL) return;
diff --git a/src/game-server/character.hpp b/src/game-server/character.hpp
index ea979184..a5616480 100644
--- a/src/game-server/character.hpp
+++ b/src/game-server/character.hpp
@@ -77,11 +77,6 @@ class Character : public Being
void respawn();
/**
- * Returns the path to the character's current destination.
- */
- std::list<PATH_NODE> findPath();
-
- /**
* makes the character perform a special action
* when it is allowed to do so
*/
diff --git a/src/game-server/state.cpp b/src/game-server/state.cpp
index 9df353a1..dcfb9139 100644
--- a/src/game-server/state.cpp
+++ b/src/game-server/state.cpp
@@ -267,15 +267,12 @@ static void informPlayer(MapComposite *map, Character *p)
if (!wereInRange)
{
// o is now visible by p. Send enter message.
- flags |= MOVING_POSITION;
- flags |= MOVING_DESTINATION;
-
MessageOut enterMsg(GPMSG_BEING_ENTER);
enterMsg.writeByte(otype);
enterMsg.writeShort(oid);
enterMsg.writeByte(static_cast< Being *>(o)->getAction());
- enterMsg.writeShort(opos.x); // aren't these two lines redundand considering
- enterMsg.writeShort(opos.y); // that a MOVING_POSITION message is following?
+ enterMsg.writeShort(opos.x);
+ enterMsg.writeShort(opos.y);
switch (otype)
{
case OBJECT_CHARACTER:
@@ -308,22 +305,9 @@ static void informPlayer(MapComposite *map, Character *p)
gameHandler->sendTo(p, enterMsg);
}
- /* At this point, either o has entered p's range, either o is
- moving inside p's range. Report o's movements. */
-
- Point odst = o->getDestination();
- if (opos != odst)
+ if (opos != oold)
{
flags |= MOVING_POSITION;
- if (oflags & UPDATEFLAG_NEW_DESTINATION)
- {
- flags |= MOVING_DESTINATION;
- }
- }
- else
- {
- // No need to synchronize on the very last step.
- flags |= MOVING_DESTINATION;
}
// Send move messages.
@@ -331,14 +315,10 @@ static void informPlayer(MapComposite *map, Character *p)
moveMsg.writeByte(flags);
if (flags & MOVING_POSITION)
{
- moveMsg.writeCoordinates(opos.x / 32, opos.y / 32);
+ moveMsg.writeShort(opos.x);
+ moveMsg.writeShort(opos.y);
moveMsg.writeByte(o->getSpeed() / 10);
}
- if (flags & MOVING_DESTINATION)
- {
- moveMsg.writeShort(odst.x);
- moveMsg.writeShort(odst.y);
- }
}
// Do not send a packet if nothing happened in p's range.