From dc6568962a32ddb6f231c629e7ad3373e9086b6c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 18 Sep 2013 23:07:40 +0300 Subject: remove useless conditions. --- src/being/localplayer.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/being/localplayer.cpp') diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 04bb2603a..f78dd7329 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -990,7 +990,7 @@ void LocalPlayer::setDestination(const int x, const int y) Net::getPlayerHandler()->setDestination(x, y, mDirection); Being::setDestination(x, y); } - else if (mInvertDirection == 1) + else { uint8_t newDir = 0; if (mDirection & UP) @@ -1011,9 +1011,7 @@ void LocalPlayer::setDestination(const int x, const int y) } Being::setDestination(x, y); - } - else - { + #ifdef MANASERV_SUPPORT // Manaserv: // If the destination given to being class is accepted, @@ -1244,7 +1242,7 @@ void LocalPlayer::attack(Being *const target, const bool keep, if (!target || target->getType() == ActorSprite::NPC) return; - if (mTarget != target || !mTarget) + if (mTarget != target) setTarget(target); #ifdef MANASERV_SUPPORT @@ -3349,7 +3347,7 @@ void LocalPlayer::setHome() } else { - if (specialLayer && iter != mHomes.end()) + if (iter != mHomes.end()) { specialLayer->setTile(static_cast(pos.x), static_cast(pos.y), MapItem::EMPTY); @@ -3817,7 +3815,7 @@ void LocalPlayer::attack2(Being *const target, const bool keep, return; } setTarget(target); - if (target && target->getType() != Being::NPC) + if (target->getType() != Being::NPC) { mKeepAttacking = true; moveToTarget(); -- cgit v1.2.3-70-g09d2