aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
author_manuel_ <manue.l@live.com.ar>2010-03-21 14:57:49 -0300
committer_manuel_ <manue.l@live.com.ar>2010-03-21 14:57:49 -0300
commitfae77f26210b4090271bb9227083c8c5240b715c (patch)
tree92f232b8a3f6216f77e2362e9b96ee821201a84d /src/game/Unit.cpp
parent2c34b6d376edf97e16902017c5fa8bd66d0162b1 (diff)
Add additional field for storage of speed_run rate of creature
This allow independent rate of walk vs run speed. Existing field renamed to explicit speed_walk. Note that default database rate for run is a result of the most common value seen, 8.0/7.0 Author: NoFantasy. --HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 3d63555ab0b..4f97861c9a1 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -292,6 +292,7 @@ void Unit::SendMonsterMoveWithSpeedToCurrentDestination(Player* player)
SendMonsterMoveWithSpeed(x, y, z, 0, player);
}
+
void Unit::SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime, Player* player)
{
if (!transitTime)
@@ -421,8 +422,9 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 M
data << uint32(MovementFlags);
- if (MovementFlags & MONSTER_MOVE_WALK)
- moveTime *= 1.05f;
+ //enable me if things goes wrong or looks ugly, it is however an old hack
+ //if (MovementFlags & MONSTER_MOVE_WALK)
+ //moveTime *= 1.05f;
data << uint32(moveTime); // Time in between points
data << uint32(1); // 1 single waypoint
@@ -11744,7 +11746,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
{
// Set creature speed rate from CreatureInfo
if (GetTypeId() == TYPEID_UNIT)
- speed *= this->ToCreature()->GetCreatureInfo()->speed;
+ speed *= this->ToCreature()->GetCreatureInfo()->speed_walk;
// Normalize speed by 191 aura SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED if need
// TODO: possible affect only on MOVE_RUN