summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-02-03 19:47:38 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-02-05 16:11:23 +0100
commitcd8c1a4d5c63336b6d6ee212ad6cfdc52bad01c7 (patch)
treef0683498a43378e54e8b96203718d1d6c698e38e /src
parent1d6723caf7def24c567b5fca260bd55ae6423952 (diff)
downloadmana-cd8c1a4d5c63336b6d6ee212ad6cfdc52bad01c7.tar.gz
mana-cd8c1a4d5c63336b6d6ee212ad6cfdc52bad01c7.tar.bz2
mana-cd8c1a4d5c63336b6d6ee212ad6cfdc52bad01c7.tar.xz
mana-cd8c1a4d5c63336b6d6ee212ad6cfdc52bad01c7.zip
Revert "Checking being positions send by the server"
This reverts commit 92fd074aa85e2357bfe1ab642209dd5a0d87e4d5. Reverting because these checks should be done server-side and because having them in the client would currently require wrapping them up in checks if there is even a current map due to the reliance on tile size (we need to handle the case where the current map didn't load properly without crashing). Conflicts: src/map.cpp src/net/manaserv/beinghandler.cpp Reviewed-by: Erik Schilling
Diffstat (limited to 'src')
-rw-r--r--src/map.cpp5
-rw-r--r--src/map.h5
-rw-r--r--src/net/manaserv/beinghandler.cpp26
3 files changed, 0 insertions, 36 deletions
diff --git a/src/map.cpp b/src/map.cpp
index b91c15ec..89bcf061 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -628,11 +628,6 @@ bool Map::contains(int x, int y) const
return x >= 0 && y >= 0 && x < mWidth && y < mHeight;
}
-bool Map::containsPixel(int x, int y) const
-{
- return contains(x / mTileWidth, y / mTileHeight);
-}
-
MetaTile *Map::getMetaTile(int x, int y) const
{
return &mMetaTiles[x + y * mWidth];
diff --git a/src/map.h b/src/map.h
index 7f75afea..8bd47b45 100644
--- a/src/map.h
+++ b/src/map.h
@@ -333,11 +333,6 @@ class Map : public Properties
*/
TileAnimation *getAnimationForGid(int gid) const;
- /**
- * Tells whether the given pixel falls within the map boundaries.
- */
- bool containsPixel(int x, int y) const;
-
protected:
friend class Actor;
diff --git a/src/net/manaserv/beinghandler.cpp b/src/net/manaserv/beinghandler.cpp
index fb3a3644..b319fa37 100644
--- a/src/net/manaserv/beinghandler.cpp
+++ b/src/net/manaserv/beinghandler.cpp
@@ -119,14 +119,6 @@ void BeingHandler::handleBeingEnterMessage(Net::MessageIn &msg)
BeingDirection direction = (BeingDirection)msg.readInt8();
Being *being;
- if (!Game::instance()->getCurrentMap()->containsPixel(px, py))
- {
- logger->log("Warning: Received GPMSG_BEING_ENTER for being id %i "
- "with position outside the map boundaries "
- "(x = %i, y = %i)", id, px, py);
- return;
- }
-
switch (type)
{
case OBJECT_CHARACTER:
@@ -230,14 +222,6 @@ void BeingHandler::handleBeingsMoveMessage(Net::MessageIn &msg)
// the being position
if (flags & MOVING_POSITION)
{
- if (!being->getMap()->containsPixel(sx, sy))
- {
- logger->log("Warning: Received GPMSG_BEINGS_MOVE for being id "
- "%i with position outside the map boundaries "
- "(x = %i, y = %i)", id, sx, sy);
- continue;
- }
-
Vector serverPos(sx, sy);
if (serverPos.length()
- being->getPosition().length() > POSITION_DIFF_TOLERANCE)
@@ -245,17 +229,7 @@ void BeingHandler::handleBeingsMoveMessage(Net::MessageIn &msg)
}
if (flags & MOVING_DESTINATION)
- {
- if (!being->getMap()->containsPixel(dx, dy))
- {
- logger->log("Warning: Received GPMSG_BEINGS_MOVE for being id "
- "%i with destination outside the map boundaries "
- "(x = %i, y = %i)", id, dx, dy);
- continue;
- }
-
being->setDestination(dx, dy);
- }
}
}