Core/MMaps: Implemented a way to enable/disable certain terrain types for movement on the entire map
Port From (https://github.com/TrinityCore/TrinityCore/commit/da0ba86694010fcb1adb5ed88cbc212dd4a33ab5)
This commit is contained in:
@@ -3211,6 +3211,17 @@ namespace Game.Maps
|
|||||||
|
|
||||||
public TerrainInfo GetTerrain() { return m_terrain; }
|
public TerrainInfo GetTerrain() { return m_terrain; }
|
||||||
|
|
||||||
|
// custom PathGenerator include and exclude filter flags
|
||||||
|
// these modify what kind of terrain types are available in current instance
|
||||||
|
// for example this can be used to mark offmesh connections as enabled/disabled
|
||||||
|
public ushort GetForceEnabledNavMeshFilterFlags() { return m_forceEnabledNavMeshFilterFlags; }
|
||||||
|
public void SetForceEnabledNavMeshFilterFlag(ushort flag) { m_forceEnabledNavMeshFilterFlags |= flag; }
|
||||||
|
public void RemoveForceEnabledNavMeshFilterFlag(ushort flag) { m_forceEnabledNavMeshFilterFlags &= (ushort)~flag; }
|
||||||
|
|
||||||
|
public ushort GetForceDisabledNavMeshFilterFlags() { return m_forceDisabledNavMeshFilterFlags; }
|
||||||
|
public void SetForceDisabledNavMeshFilterFlag(ushort flag) { m_forceDisabledNavMeshFilterFlags |= flag; }
|
||||||
|
public void RemoveForceDisabledNavMeshFilterFlag(ushort flag) { m_forceDisabledNavMeshFilterFlags &= (ushort)~flag; }
|
||||||
|
|
||||||
public uint GetInstanceId()
|
public uint GetInstanceId()
|
||||||
{
|
{
|
||||||
return i_InstanceId;
|
return i_InstanceId;
|
||||||
@@ -4672,6 +4683,8 @@ namespace Game.Maps
|
|||||||
protected List<WorldObject> m_activeNonPlayers = new();
|
protected List<WorldObject> m_activeNonPlayers = new();
|
||||||
protected List<Player> m_activePlayers = new();
|
protected List<Player> m_activePlayers = new();
|
||||||
TerrainInfo m_terrain;
|
TerrainInfo m_terrain;
|
||||||
|
ushort m_forceEnabledNavMeshFilterFlags;
|
||||||
|
ushort m_forceDisabledNavMeshFilterFlags;
|
||||||
|
|
||||||
SortedMultiMap<long, ScriptAction> m_scriptSchedule = new();
|
SortedMultiMap<long, ScriptAction> m_scriptSchedule = new();
|
||||||
|
|
||||||
|
|||||||
@@ -868,6 +868,9 @@ namespace Game.Movement
|
|||||||
|
|
||||||
void UpdateFilter()
|
void UpdateFilter()
|
||||||
{
|
{
|
||||||
|
_filter.setIncludeFlags((ushort)(_filter.getIncludeFlags() | _source.GetMap().GetForceEnabledNavMeshFilterFlags()));
|
||||||
|
_filter.setExcludeFlags((ushort)(_filter.getExcludeFlags() | _source.GetMap().GetForceDisabledNavMeshFilterFlags()));
|
||||||
|
|
||||||
// allow creatures to cheat and use different movement types if they are moved
|
// allow creatures to cheat and use different movement types if they are moved
|
||||||
// forcefully into terrain they can't normally move in
|
// forcefully into terrain they can't normally move in
|
||||||
Unit _sourceUnit = _source.ToUnit();
|
Unit _sourceUnit = _source.ToUnit();
|
||||||
|
|||||||
Reference in New Issue
Block a user