Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Core/Movement: Minor correction for last changeset

  • Loading branch information...
commit a4a1e19f013f01dbbc6e69758e4f9b21463469c6 1 parent 8358af9
@kaelima kaelima authored
View
15 src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
@@ -49,16 +49,13 @@ void ConfusedMovementGenerator<T>::Initialize(T &unit)
float const wanderX = x + (wander_distance * (float)rand_norm() - wander_distance/2);
float const wanderY = y + (wander_distance * (float)rand_norm() - wander_distance/2);
- i_waypoints[idx][0] = wanderX;
- i_waypoints[idx][1] = wanderY;
-
// prevent invalid coordinates generation
- Trinity::NormalizeMapCoord(i_waypoints[idx][0]);
- Trinity::NormalizeMapCoord(i_waypoints[idx][1]);
+ Trinity::NormalizeMapCoord(wanderX);
+ Trinity::NormalizeMapCoord(wanderY);
if (unit.IsWithinLOS(wanderX, wanderY, z))
{
- bool is_water = map->IsInWater(i_waypoints[idx][0], i_waypoints[idx][1], z);
+ bool is_water = map->IsInWater(wanderX, wanderY, z);
if ((is_water && !is_water_ok) || (!is_water && !is_land_ok))
{
@@ -67,7 +64,11 @@ void ConfusedMovementGenerator<T>::Initialize(T &unit)
i_waypoints[idx][1] = idx > 0 ? i_waypoints[idx-1][1] : y;
}
- unit.UpdateAllowedPositionZ(i_waypoints[idx][0], i_waypoints[idx][1], z);
+ unit.UpdateAllowedPositionZ(wanderX, wanderY, z);
+
+ //! Positions are now fine - apply them to this waypoint
+ i_waypoints[idx][0] = wanderX;
+ i_waypoints[idx][1] = wanderY;
i_waypoints[idx][2] = z;
}
else

1 comment on commit a4a1e19

@Vincent-Michael
Collaborator

Fehler 1 error C2664: 'Trinity::NormalizeMapCoord': Konvertierung des Parameters 1 von 'const float' in 'float &' nicht möglich D:\bf-trinitycore-git\src\server\game\Movement\MovementGenerators\ConfusedMovementGenerator.cpp 53
Fehler 2 error C2664: 'Trinity::NormalizeMapCoord': Konvertierung des Parameters 1 von 'const float' in 'float &' nicht möglich D:\bf-trinitycore-git\src\server\game\Movement\MovementGenerators\ConfusedMovementGenerator.cpp 54
Fehler 3 error C2664: 'Trinity::NormalizeMapCoord': Konvertierung des Parameters 1 von 'const float' in 'float &' nicht möglich D:\bf-trinitycore-git\src\server\game\Movement\MovementGenerators\ConfusedMovementGenerator.cpp 53
Fehler 4 error C2664: 'Trinity::NormalizeMapCoord': Konvertierung des Parameters 1 von 'const float' in 'float &' nicht möglich D:\bf-trinitycore-git\src\server\game\Movement\MovementGenerators\ConfusedMovementGenerator.cpp 54

correct?

 .../ConfusedMovementGenerator.cpp                  |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
index 2dcd9b5..03bc257 100755
--- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
@@ -46,8 +46,8 @@ void ConfusedMovementGenerator<T>::Initialize(T &unit)

     for (uint8 idx = 0; idx < MAX_CONF_WAYPOINTS + 1; ++idx)
     {
-        float const wanderX = x + (wander_distance * (float)rand_norm() - wander_distance/2);
-        float const wanderY = y + (wander_distance * (float)rand_norm() - wander_distance/2);
+        float wanderX = x + (wander_distance * (float)rand_norm() - wander_distance/2);
+        float wanderY = y + (wander_distance * (float)rand_norm() - wander_distance/2);

         // prevent invalid coordinates generation
         Trinity::NormalizeMapCoord(wanderX);
Please sign in to comment.
Something went wrong with that request. Please try again.