summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-08-27 11:21:10 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-08-27 11:21:10 +0000
commitd3cba1c4beac4a1c98f38bbca076a98f9c90bbc4 (patch)
treee7d1ea0a7575d0dd28802e7dfe2a322e818729fc /src/net
parent5980dba7ace73e6587b9966bc2076ad2b2eaa5f0 (diff)
downloadmana-client-d3cba1c4beac4a1c98f38bbca076a98f9c90bbc4.tar.gz
mana-client-d3cba1c4beac4a1c98f38bbca076a98f9c90bbc4.tar.bz2
mana-client-d3cba1c4beac4a1c98f38bbca076a98f9c90bbc4.tar.xz
mana-client-d3cba1c4beac4a1c98f38bbca076a98f9c90bbc4.zip
Changed to pixel-based coordinates for beings.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/beinghandler.cpp8
-rw-r--r--src/net/playerhandler.cpp6
2 files changed, 6 insertions, 8 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp
index 4ff92b63..ac2801c2 100644
--- a/src/net/beinghandler.cpp
+++ b/src/net/beinghandler.cpp
@@ -422,16 +422,16 @@ void BeingHandler::handleBeingsMoveMessage(MessageIn &msg)
int sx = msg.readShort(), sy = msg.readShort(),
dx = msg.readShort(), dy = msg.readShort();
bool update = being != player_node; // the local player already knows where he wants to go
- if (abs(being->mX - sx / 32) + abs(being->mY - sy / 32) > 4)
+ if (abs(being->mX - sx) + abs(being->mY - sy) > 4 * 32)
{
// crude handling of synchronization messages
- being->mX = sx / 32;
- being->mY = sy / 32;
+ being->mX = sx;
+ being->mY = sy;
update = true;
}
if (update)
{
- being->setDestination(dx / 32, dy / 32);
+ being->setDestination(dx, dy);
}
}
}
diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp
index c73aa2da..fc6bb37d 100644
--- a/src/net/playerhandler.cpp
+++ b/src/net/playerhandler.cpp
@@ -321,10 +321,8 @@ PlayerHandler::handleMapChangeMessage(MessageIn &msg)
player_node->stopAttack();
player_node->mFrame = 0;
- // TODO: Server is sending pixel coordinates. Client will need to work with
- // these instead of converting them to tile coordinates.
- player_node->mX = x / 32;
- player_node->mY = y / 32;
+ player_node->mX = x;
+ player_node->mY = y;
if (newServer)
{