From f98d003e354a1792117b7cbc771d1dd91475a156 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 18 Mar 2011 17:48:29 +0200 Subject: Fix most old style cast except manaserv and libxml2 defines. --- src/being.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/being.cpp') diff --git a/src/being.cpp b/src/being.cpp index 1d3b78293..8604f0053 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -340,8 +340,8 @@ void Being::setPosition(const Vector &pos) if (mText) { - mText->adviseXY((int)pos.x, - (int)pos.y - getHeight() - mText->getHeight() - 6); + mText->adviseXY(static_cast(pos.x), static_cast(pos.y) + - getHeight() - mText->getHeight() - 6); } } @@ -379,8 +379,8 @@ void Being::setDestination(int dstX, int dstY) { // If there is no path but the destination is on the same walkable tile, // we accept it. - if ((int)mPos.x / 32 == dest.x / 32 - && (int)mPos.y / 32 == dest.y / 32) + if (static_cast(mPos.x) / 32 == dest.x / 32 + && static_cast(mPos.y) / 32 == dest.y / 32) { mDest.x = static_cast(dest.x); mDest.y = static_cast(dest.y); @@ -1044,7 +1044,7 @@ void Being::nextTile() mX = pos.x; mY = pos.y; setAction(MOVE); - mActionTime += (int)(mWalkSpeed.x / 10); + mActionTime += static_cast(mWalkSpeed.x / 10); } int Being::getCollisionRadius() const @@ -1162,9 +1162,9 @@ void Being::logic() case MOVE: { - if (getWalkSpeed().x - && (int) ((get_elapsed_time(mActionTime) * frameCount) - / getWalkSpeed().x) >= frameCount) + if (getWalkSpeed().x && static_cast ((get_elapsed_time( + mActionTime) * frameCount) / getWalkSpeed().x) + >= frameCount) { nextTile(); } @@ -1249,7 +1249,7 @@ void Being::logic() if (!isAlive() && getWalkSpeed().x && Net::getGameHandler()->removeDeadBeings() - && (int) ((get_elapsed_time(mActionTime) + && static_cast ((get_elapsed_time(mActionTime) / getWalkSpeed().x) >= static_cast(frameCount))) { if (getType() != PLAYER && actorSpriteManager) @@ -1335,10 +1335,10 @@ int Being::getOffset(char pos, char neg) const if (mMap) { offset = (pos == LEFT && neg == RIGHT) ? - (int)((static_cast(get_elapsed_time(mActionTime)) + static_cast((static_cast(get_elapsed_time(mActionTime)) * static_cast(mMap->getTileWidth())) / static_cast(mWalkSpeed.x)) : - (int)((static_cast(get_elapsed_time(mActionTime)) + static_cast((static_cast(get_elapsed_time(mActionTime)) * static_cast(mMap->getTileHeight())) / static_cast(mWalkSpeed.y)); } -- cgit v1.2.3-60-g2f50