|
From: <cn...@us...> - 2021-07-21 21:17:49
|
Revision: 1193
http://sourceforge.net/p/seq/svn/1193
Author: cn187
Date: 2021-07-21 21:17:47 +0000 (Wed, 21 Jul 2021)
Log Message:
-----------
Fix NPC Walk Paths display bug (Newby)
Modified Paths:
--------------
showeq/trunk/src/mapicon.cpp
Modified: showeq/trunk/src/mapicon.cpp
===================================================================
--- showeq/trunk/src/mapicon.cpp 2021-07-21 21:17:40 UTC (rev 1192)
+++ showeq/trunk/src/mapicon.cpp 2021-07-21 21:17:47 UTC (rev 1193)
@@ -1023,39 +1023,43 @@
if (mapIcon.showWalkPath() ||
(m_showNPCWalkPaths && spawn->isNPC()))
{
+ const SpawnTrackList& trackList = spawn->trackList();
SpawnTrackListIterator trackIt(spawn->trackList());
+ int cnt = trackList.count ();
- const SpawnTrackPoint* trackPoint = trackIt.next();
- if (trackPoint)
- {
- if (!mapIcon.useWalkPathPen())
- p.setPen(Qt::blue);
- else
- p.setPen(mapIcon.walkPathPen());
+ if (cnt >= 2) { // only make a line if there is more than one point
+ const SpawnTrackPoint* trackPoint = trackIt.next();
+ if (trackPoint)
+ {
+ if (!mapIcon.useWalkPathPen())
+ p.setPen(Qt::blue);
+ else
+ p.setPen(mapIcon.walkPathPen());
- int16_t x_1, y_1, x_2, y_2;
+ int16_t x_1, y_1, x_2, y_2;
- x_1 = trackPoint->x();
- y_1 = trackPoint->y();
+ x_1 = trackPoint->x();
+ y_1 = trackPoint->y();
- while (trackIt.hasNext())
- {
- trackPoint = trackIt.next();
- if (!trackPoint)
- break;
+ while (trackIt.hasNext())
+ {
+ trackPoint = trackIt.next();
+ if (!trackPoint)
+ break;
- x_2 = trackPoint->x();
- y_2 = trackPoint->y();
+ x_2 = trackPoint->x();
+ y_2 = trackPoint->y();
- p.drawLine (param.calcXOffsetI(x_1),
- param.calcYOffsetI(y_1),
- param.calcXOffsetI(x_2),
- param.calcYOffsetI(y_2));
- x_1 = x_2;
- y_1 = y_2;
- }
+ p.drawLine (param.calcXOffsetI(x_1),
+ param.calcYOffsetI(y_1),
+ param.calcXOffsetI(x_2),
+ param.calcYOffsetI(y_2));
+ x_1 = x_2;
+ y_1 = y_2;
+ }
- p.drawLine (x_2, y_2, point.x(), point.y());
+ p.drawLine (param.calcXOffsetI(x_2), param.calcYOffsetI(y_2), point.x(), point.y());
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|