aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-06-15 12:02:55 -0500
committermegamage <none@none>2009-06-15 12:02:55 -0500
commitb9610f27dd2c55f63f9a96f1259a8dce33b71d88 (patch)
tree4920b011dc839e2c4901e31d8996a206bff63808 /src/game/Player.cpp
parent4d6fb6c8b2d84996711fa8bc41e71fa6d483b98c (diff)
*Check movementflag to interrupt casting instead of checking position.
*Also some other fixes about movement flags. --HG-- branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r--src/game/Player.cpp39
1 files changed, 18 insertions, 21 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 7abe7f67d55..68545b6a379 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -5635,38 +5635,35 @@ bool Player::SetPosition(float x, float y, float z, float orientation, bool tele
return false;
}
- Map *m = GetMap();
+ //if(movementInfo.flags & MOVEMENTFLAG_MOVING)
+ // mover->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOVE);
+ //if(movementInfo.flags & MOVEMENTFLAG_TURNING)
+ // mover->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TURNING);
+ //AURA_INTERRUPT_FLAG_JUMP not sure
- const float old_x = GetPositionX();
- const float old_y = GetPositionY();
- const float old_z = GetPositionZ();
- const float old_r = GetOrientation();
+ if(GetOrientation() != orientation)
+ RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TURNING);
- if( teleport || old_x != x || old_y != y || old_z != z || old_r != orientation )
+ bool move2d = (teleport || GetPositionX() != x || GetPositionY() != y);
+ if(move2d || GetPositionZ() != z)
{
- if (teleport || old_x != x || old_y != y || old_z != z)
- RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOVE | AURA_INTERRUPT_FLAG_TURNING);
- else
- RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TURNING);
+ RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOVE);
// move and update visible state if need
- m->PlayerRelocation(this, x, y, z, orientation);
+ GetMap()->PlayerRelocation(this, x, y, z, orientation);
// reread after Map::Relocation
- m = GetMap();
- x = GetPositionX();
- y = GetPositionY();
- z = GetPositionZ();
+ GetPosition(x, y, z);
// group update
- if(GetGroup() && (old_x != x || old_y != y))
+ if(move2d && GetGroup())
SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION);
- }
- // code block for underwater state update
- UpdateUnderwaterState(m, x, y, z);
+ // code block for underwater state update
+ UpdateUnderwaterState(GetMap(), x, y, z);
- CheckExploreSystem();
+ CheckExploreSystem();
+ }
return true;
}
@@ -6415,7 +6412,7 @@ void Player::CheckDuelDistance(time_t currTime)
bool Player::IsOutdoorPvPActive()
{
- return (isAlive() && !HasInvisibilityAura() && !HasStealthAura() && (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP) || sWorld.IsPvPRealm()) && !HasUnitMovementFlag(MOVEMENTFLAG_FLYING2) && !isInFlight());
+ return (isAlive() && !HasInvisibilityAura() && !HasStealthAura() && (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP) || sWorld.IsPvPRealm()) && !HasUnitMovementFlag(MOVEMENTFLAG_FLYING) && !isInFlight());
}
void Player::DuelComplete(DuelCompleteType type)