Validate the spawn distance passed to RandomMovementGenerator constructor.
This commit is contained in:
parent
0dda46f1f9
commit
a1a3a0b0fb
@ -30,6 +30,17 @@
|
|||||||
#include "movement/MoveSplineInit.h"
|
#include "movement/MoveSplineInit.h"
|
||||||
#include "movement/MoveSpline.h"
|
#include "movement/MoveSpline.h"
|
||||||
|
|
||||||
|
template<>
|
||||||
|
RandomMovementGenerator<Creature>::RandomMovementGenerator(float x, float y, float z, float radius, float verticalZ) :
|
||||||
|
i_nextMoveTime(0), i_x(x), i_y(y), i_z(z), i_radius(radius), i_verticalZ(verticalZ)
|
||||||
|
{
|
||||||
|
if (radius < 0.1f)
|
||||||
|
{
|
||||||
|
DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "RandomMovementGenerator<Creature> constructor: wrong value for spawn distance. Set to 0.1f");
|
||||||
|
i_radius = 0.1f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
RandomMovementGenerator<Creature>::RandomMovementGenerator(const Creature& creature)
|
RandomMovementGenerator<Creature>::RandomMovementGenerator(const Creature& creature)
|
||||||
{
|
{
|
||||||
|
@ -36,8 +36,7 @@ class RandomMovementGenerator
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit RandomMovementGenerator(const Creature&);
|
explicit RandomMovementGenerator(const Creature&);
|
||||||
explicit RandomMovementGenerator(float x, float y, float z, float radius, float verticalZ = 0.0f) :
|
explicit RandomMovementGenerator(float x, float y, float z, float radius, float verticalZ = 0.0f);
|
||||||
i_nextMoveTime(0), i_x(x), i_y(y), i_z(z), i_radius(radius), i_verticalZ(verticalZ) {}
|
|
||||||
|
|
||||||
void _setRandomLocation(T&);
|
void _setRandomLocation(T&);
|
||||||
void Initialize(T&);
|
void Initialize(T&);
|
||||||
|
@ -38,6 +38,6 @@
|
|||||||
|
|
||||||
#define WORLD_DB_VERSION_NR 21
|
#define WORLD_DB_VERSION_NR 21
|
||||||
#define WORLD_DB_STRUCTURE_NR 3
|
#define WORLD_DB_STRUCTURE_NR 3
|
||||||
#define WORLD_DB_CONTENT_NR 1
|
#define WORLD_DB_CONTENT_NR 2
|
||||||
#define WORLD_DB_UPDATE_DESCRIPTION "Fix SoR paladin"
|
#define WORLD_DB_UPDATE_DESCRIPTION "Fix Random MMGen Scripts"
|
||||||
#endif // __REVISION_H__
|
#endif // __REVISION_H__
|
||||||
|
Loading…
x
Reference in New Issue
Block a user