From 995a443da219ec773febd7dd29d18f3cefaa1f3b Mon Sep 17 00:00:00 2001 From: Giacomo Pozzoni Date: Wed, 17 Jun 2020 20:20:26 +0000 Subject: Handle different slopes in mmaps (#24765) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Tools/MMAPs: Remove input argument --maxAngle Remove input argument --maxAngle . This should be just hardcoded in MapBuilder::GetMapSpecificConfig() so all settings are easily found in the same place instead of being spread around. * Tools/MMAPs: Add new area type NAV_AREA_GROUND_STEEP Add new area type NAV_AREA_GROUND_STEEP for ground with slope in the range (55, 70] . NAV_AREA_GROUND is used for ground with range [0, 55] . NAV_AREA_GROUND_STEEP takes priority over NAV_AREA_GROUND. * Tools/MMAPs: Fix NAV_GROUND_STEEP flag not being saved in the mmtile * Core/PathFinding: Implement NAV_GROUND_STEEP flag Implement NAV_GROUND_STEEP flag, used only by Creatures that are in combat or evading. * Distinguish between RC_WALKABLE_AREA and NAV_AREA_GROUND. * Allow mobs in combat to walk on steeps up to 80° * Allow mobs in combat to walk on steeps up to 85°. Disable rcFilterLedgeSpans() filter as it removed long steep spans. * Increase cost of steep spans to try making creatures walk around obstacles instead of walking on them * Revert last commit --- src/server/game/Movement/PathGenerator.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/server/game') diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index af6b8b0b30c..305c6b2bd67 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -678,6 +678,7 @@ void PathGenerator::UpdateFilter() // allow creatures to cheat and use different movement types if they are moved // forcefully into terrain they can't normally move in if (Unit const* _sourceUnit = _source->ToUnit()) + { if (_sourceUnit->IsInWater() || _sourceUnit->IsUnderWater()) { uint16 includedFlags = _filter.getIncludeFlags(); @@ -687,6 +688,11 @@ void PathGenerator::UpdateFilter() _filter.setIncludeFlags(includedFlags); } + + if (Creature const* _sourceCreature = _source->ToCreature()) + if (_sourceCreature->IsInCombat() || _sourceCreature->IsInEvadeMode()) + _filter.setIncludeFlags(_filter.getIncludeFlags() | NAV_GROUND_STEEP); + } } NavTerrainFlag PathGenerator::GetNavTerrain(float x, float y, float z) -- cgit v1.2.3