diff options
author | megamage <none@none> | 2009-06-11 00:45:59 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-06-11 00:45:59 -0500 |
commit | 9d670fe6f5757430d575081db9a6e5273400330d (patch) | |
tree | 9148b75f310fda0bf082be70731abfca03e84f20 /src/game/RandomMovementGenerator.cpp | |
parent | 9c70e3d89bbace30bfabcf8c42323472ad1e4c4d (diff) |
*Switch to support client version 3.1.3
*I strongly recommend you not to use this until you get the 313 db. Now all destructible buildings cause client crash.
Source: Mangos
Thanks to TOM_RUS for most work to make this switch possible ;)
--HG--
branch : trunk
Diffstat (limited to 'src/game/RandomMovementGenerator.cpp')
-rw-r--r-- | src/game/RandomMovementGenerator.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/game/RandomMovementGenerator.cpp b/src/game/RandomMovementGenerator.cpp index 46a3b6086db..6d3648d51e4 100644 --- a/src/game/RandomMovementGenerator.cpp +++ b/src/game/RandomMovementGenerator.cpp @@ -130,7 +130,7 @@ RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature) else { i_nextMoveTime.Reset(urand(500+i_destinationHolder.GetTotalTravelTime(),5000+i_destinationHolder.GetTotalTravelTime())); - creature.SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE); + creature.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); } //Call for creature group update @@ -152,8 +152,8 @@ RandomMovementGenerator<Creature>::Initialize(Creature &creature) if (creature.canFly()) creature.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); - else - creature.SetUnitMovementFlags(irand(0,RUNNING_CHANCE_RANDOMMV) > 0 ? MOVEMENTFLAG_WALK_MODE : MOVEMENTFLAG_NONE ); + else if(irand(0,RUNNING_CHANCE_RANDOMMV) > 0) + creature.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); _setRandomLocation(creature); } @@ -195,13 +195,13 @@ RandomMovementGenerator<Creature>::Update(Creature &creature, const uint32 &diff { if (creature.canFly()) creature.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); - else - creature.SetUnitMovementFlags(irand(0,RUNNING_CHANCE_RANDOMMV) > 0 ? MOVEMENTFLAG_WALK_MODE : MOVEMENTFLAG_NONE); + else if(irand(0,RUNNING_CHANCE_RANDOMMV) > 0) + creature.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); _setRandomLocation(creature); } else if(creature.isPet() && creature.GetOwner() && !creature.IsWithinDist(creature.GetOwner(),PET_FOLLOW_DIST+2.5f)) { - creature.SetUnitMovementFlags(MOVEMENTFLAG_NONE); + creature.RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); _setRandomLocation(creature); } } |