aboutsummaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorGiacomo Pozzoni <giacomopoz@gmail.com>2020-01-09 19:38:45 +0100
committerGitHub <noreply@github.com>2020-01-09 19:38:45 +0100
commit29bf280e3496cf13c24ccb20e37da29d3bfa74d9 (patch)
tree06d03127439ac2f050aee937ef89f4d3944eb4c9 /src/tools
parent43b247e17e8f5df4eda74578499f5a9758c3852b (diff)
Core/PathGenerator: Fix path generator returning shortcuts when start and end are on the same polygon (#24036)
* Core/PathGenerator: Fix path generator returning shortcuts when start and end are on the same polygon Fix path generator returning shortcuts when start and end are on the same polygon by handling this case as if start and end were on 2 different polygons. This will ensure BuildPointPath() gets called which calls FindSmoothPath(), making sure each step is not longer than SMOOTH_PATH_STEP_SIZE (4 yards) * Change ingame cast error message to SPELL_FAILED_NOPATH from SPELL_FAILED_OUT_OF_RANGE if the generated path is too long
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/mmaps_generator/MapBuilder.cpp26
-rw-r--r--src/tools/mmaps_generator/MapBuilder.h1
2 files changed, 17 insertions, 10 deletions
diff --git a/src/tools/mmaps_generator/MapBuilder.cpp b/src/tools/mmaps_generator/MapBuilder.cpp
index 35ede6fb9f4..6b10adb4abe 100644
--- a/src/tools/mmaps_generator/MapBuilder.cpp
+++ b/src/tools/mmaps_generator/MapBuilder.cpp
@@ -877,16 +877,8 @@ namespace MMAP
return static_cast<uint32>(m_mapid) != mapID;
if (m_skipContinents)
- switch (mapID)
- {
- case 0:
- case 1:
- case 530:
- case 571:
- return true;
- default:
- break;
- }
+ if (isContinentMap(mapID))
+ return true;
if (m_skipJunkMaps)
switch (mapID)
@@ -966,6 +958,20 @@ namespace MMAP
}
}
+ bool MapBuilder::isContinentMap(uint32 mapID)
+ {
+ switch (mapID)
+ {
+ case 0:
+ case 1:
+ case 530:
+ case 571:
+ return true;
+ default:
+ return false;
+ }
+ }
+
/**************************************************************************/
bool MapBuilder::shouldSkipTile(uint32 mapID, uint32 tileX, uint32 tileY)
{
diff --git a/src/tools/mmaps_generator/MapBuilder.h b/src/tools/mmaps_generator/MapBuilder.h
index b7ad8cb04b4..753ce8c7237 100644
--- a/src/tools/mmaps_generator/MapBuilder.h
+++ b/src/tools/mmaps_generator/MapBuilder.h
@@ -143,6 +143,7 @@ namespace MMAP
bool shouldSkipMap(uint32 mapID);
bool isTransportMap(uint32 mapID);
+ bool isContinentMap(uint32 mapID);
bool shouldSkipTile(uint32 mapID, uint32 tileX, uint32 tileY);
rcConfig GetMapSpecificConfig(uint32 mapID, float bmin[3], float bmax[3], const TileConfig &tileConfig);