More changes for mmaps.
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include "Creature.h"
|
||||
#include "MapManager.h"
|
||||
#include "ConfusedMovementGenerator.h"
|
||||
#include "PathFinderMovementGenerator.h"
|
||||
#include "VMapFactory.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "MoveSpline.h"
|
||||
@@ -42,8 +43,6 @@ void ConfusedMovementGenerator<T>::Initialize(T &unit)
|
||||
i_nextMove = 1;
|
||||
|
||||
bool is_water_ok, is_land_ok;
|
||||
_InitSpecific(unit, is_water_ok, is_land_ok);
|
||||
|
||||
for (uint8 idx = 0; idx < MAX_CONF_WAYPOINTS + 1; ++idx)
|
||||
{
|
||||
float wanderX = x + (wander_distance * (float)rand_norm() - wander_distance/2);
|
||||
|
||||
@@ -20,10 +20,12 @@
|
||||
#define TRINITYCORE_PATH_H
|
||||
|
||||
#include "Common.h"
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
|
||||
struct SimplePathNode
|
||||
struct PathNode
|
||||
{
|
||||
PathNode(): x(0.0f), y(0.0f), z(0.0f) { }
|
||||
PathNode(float _x, float _y, float _z): x(_x), y(_y), z(_z) { }
|
||||
float x, y, z;
|
||||
};
|
||||
template<typename PathElem, typename PathNode = PathElem>
|
||||
@@ -36,6 +38,20 @@ class Path
|
||||
void resize(unsigned int sz) { i_nodes.resize(sz); }
|
||||
void clear() { i_nodes.clear(); }
|
||||
void erase(uint32 idx) { i_nodes.erase(i_nodes.begin()+idx); }
|
||||
void crop(unsigned int start, unsigned int end)
|
||||
{
|
||||
while(start && !i_nodes.empty())
|
||||
{
|
||||
i_nodes.pop_front();
|
||||
--start;
|
||||
}
|
||||
|
||||
while(end && !i_nodes.empty())
|
||||
{
|
||||
i_nodes.pop_back();
|
||||
--end;
|
||||
}
|
||||
}
|
||||
|
||||
float GetTotalLength(uint32 start, uint32 end) const
|
||||
{
|
||||
@@ -76,10 +92,10 @@ class Path
|
||||
void set(size_t idx, PathElem elem) { i_nodes[idx] = elem; }
|
||||
|
||||
protected:
|
||||
std::vector<PathElem> i_nodes;
|
||||
std::deque<PathElem> i_nodes;
|
||||
};
|
||||
|
||||
typedef Path<SimplePathNode> SimplePath;
|
||||
typedef Path<PathNode> SimplePath;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "Memory.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Config.h"
|
||||
#include "SystemConfig.h"
|
||||
@@ -54,6 +55,7 @@
|
||||
#include "TemporarySummon.h"
|
||||
#include "WaypointMovementGenerator.h"
|
||||
#include "VMapFactory.h"
|
||||
#include "MMapFactory.h"
|
||||
#include "GameEventMgr.h"
|
||||
#include "PoolMgr.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
@@ -1121,6 +1123,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
}
|
||||
|
||||
m_bool_configs[CONFIG_VMAP_INDOOR_CHECK] = ConfigMgr::GetBoolDefault("vmap.enableIndoorCheck", 0);
|
||||
m_bool_configs[CONFIG_ENABLE_MMAPS] = ConfigMgr::GetBoolDefault("mmap.enablePathFinding", true);
|
||||
bool enableIndoor = ConfigMgr::GetBoolDefault("vmap.enableIndoorCheck", true);
|
||||
bool enableLOS = ConfigMgr::GetBoolDefault("vmap.enableLOS", true);
|
||||
bool enableHeight = ConfigMgr::GetBoolDefault("vmap.enableHeight", true);
|
||||
@@ -1216,6 +1219,9 @@ void World::SetInitialWorldSettings()
|
||||
///- Initialize the random number generator
|
||||
srand((unsigned int)time(NULL));
|
||||
|
||||
///- Initialize detour memory management
|
||||
dtAllocSetCustom(dtCustomAlloc, dtCustomFree);
|
||||
|
||||
///- Initialize config settings
|
||||
LoadConfigSettings();
|
||||
|
||||
|
||||
@@ -164,6 +164,7 @@ enum WorldBoolConfigs
|
||||
CONFIG_QUEST_IGNORE_AUTO_ACCEPT,
|
||||
CONFIG_QUEST_IGNORE_AUTO_COMPLETE,
|
||||
CONFIG_WARDEN_ENABLED,
|
||||
CONFIG_ENABLE_MMAPS,
|
||||
BOOL_CONFIG_VALUE_COUNT
|
||||
};
|
||||
|
||||
|
||||
@@ -51,6 +51,8 @@ message("")
|
||||
|
||||
include_directories(
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour
|
||||
${CMAKE_SOURCE_DIR}/dep/recastnavigation/Recast
|
||||
${CMAKE_SOURCE_DIR}/dep/g3dlite/include
|
||||
${CMAKE_SOURCE_DIR}/dep/SFMT
|
||||
${CMAKE_SOURCE_DIR}/dep/mersennetwister
|
||||
@@ -120,6 +122,7 @@ include_directories(
|
||||
${CMAKE_SOURCE_DIR}/src/server/game/Maps
|
||||
${CMAKE_SOURCE_DIR}/src/server/game/Movement
|
||||
${CMAKE_SOURCE_DIR}/src/server/game/Movement/MovementGenerators
|
||||
${CMAKE_SOURCE_DIR}/src/server/game/Movement/Spline
|
||||
${CMAKE_SOURCE_DIR}/src/server/game/Movement/Waypoints
|
||||
${CMAKE_SOURCE_DIR}/src/server/game/Opcodes
|
||||
${CMAKE_SOURCE_DIR}/src/server/game/OutdoorPvP
|
||||
|
||||
@@ -52,6 +52,7 @@ set(shared_STAT_SRCS
|
||||
|
||||
include_directories(
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour
|
||||
${CMAKE_SOURCE_DIR}/dep/SFMT
|
||||
${CMAKE_SOURCE_DIR}/dep/mersennetwister
|
||||
${CMAKE_SOURCE_DIR}/dep/sockets/include
|
||||
|
||||
@@ -45,6 +45,7 @@ endif()
|
||||
include_directories(
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_SOURCE_DIR}/dep/g3dlite/include
|
||||
${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour
|
||||
${CMAKE_SOURCE_DIR}/dep/gsoap
|
||||
${CMAKE_SOURCE_DIR}/dep/sockets/include
|
||||
${CMAKE_SOURCE_DIR}/dep/SFMT
|
||||
@@ -168,6 +169,7 @@ target_link_libraries(worldserver
|
||||
collision
|
||||
g3dlib
|
||||
gsoap
|
||||
Detour
|
||||
${JEMALLOC_LIBRARY}
|
||||
${READLINE_LIBRARY}
|
||||
${TERMCAP_LIBRARY}
|
||||
|
||||
Reference in New Issue
Block a user