summaryrefslogtreecommitdiff
path: root/src/net/beinghandler.cpp
diff options
context:
space:
mode:
authorLloyd Bryant <lloyd_bryant@netzero.net>2008-08-22 05:39:01 +0000
committerLloyd Bryant <lloyd_bryant@netzero.net>2008-08-22 05:39:01 +0000
commit4434679b6f0d0e1345321d075f627d528f405883 (patch)
treeae7f11941f7c0b7c06260d3040521094f04d24f0 /src/net/beinghandler.cpp
parent6be958da64e96f0b0d7ae043182b3f124eadfd4e (diff)
downloadMana-4434679b6f0d0e1345321d075f627d528f405883.tar.gz
Mana-4434679b6f0d0e1345321d075f627d528f405883.tar.bz2
Mana-4434679b6f0d0e1345321d075f627d528f405883.tar.xz
Mana-4434679b6f0d0e1345321d075f627d528f405883.zip
Added config option to honor stop-walking packet, added X and Y to /where, reformatted src/chat.cpp
Diffstat (limited to 'src/net/beinghandler.cpp')
-rw-r--r--src/net/beinghandler.cpp36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp
index 5b2ac5f4..fbef02bd 100644
--- a/src/net/beinghandler.cpp
+++ b/src/net/beinghandler.cpp
@@ -40,7 +40,8 @@
const int EMOTION_TIME = 150; /**< Duration of emotion icon */
-BeingHandler::BeingHandler()
+BeingHandler::BeingHandler(bool enableSync):
+ mSync(enableSync)
{
static const Uint16 _messages[] = {
SMSG_BEING_VISIBLE,
@@ -467,25 +468,30 @@ void BeingHandler::handleMessage(MessageIn *msg)
break;
case SMSG_PLAYER_STOP:
- // Instruction from server to stop walking at x, y.
/*
- * Deactivated - it drives people on the TMW server nuts
+ * Instruction from server to stop walking at x, y.
*
- id = msg->readInt32();
- dstBeing = beingManager->findBeing(id);
+ * Some people like having this enabled. Others absolutely
+ * despise it. So I'm setting to so that it only affects the
+ * local player if the person has set a key "EnableSync" to "1"
+ * in their config.xml file.
+ *
+ * This packet will be honored for all other beings, regardless
+ * of the config setting.
+ */
- if (dstBeing) {
- dstBeing->mX = msg->readInt16();
- dstBeing->mY = msg->readInt16();
- if (dstBeing->mAction == Being::WALK) {
- dstBeing->mFrame = 0;
- dstBeing->setAction(Being::STAND);
+ id = msg->readInt32();
+ if (mSync || id != player_node->getId()) {
+ dstBeing = beingManager->findBeing(id);
+ if (dstBeing) {
+ dstBeing->mX = msg->readInt16();
+ dstBeing->mY = msg->readInt16();
+ if (dstBeing->mAction == Being::WALK) {
+ dstBeing->mFrame = 0;
+ dstBeing->setAction(Being::STAND);
+ }
}
-
- } else {
- logger->log("0x0088: Non-existent being %d", id);
}
- */
break;
case SMSG_PLAYER_MOVE_TO_ATTACK: