Skip to content

Commit 2221ad3

Browse files
committed
Scripts/Eversong Woords: Fix path id selection after 91dcae5
Closes TrinityCore#31474
1 parent 4997e31 commit 2221ad3

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,25 @@ enum Partygoer_Pather
2626
EVENT_RANDOM_ACTION_PATHER,
2727
EVENT_REMOVE_EQUIPMENT_PATHER,
2828
EVENT_STOP_DANCING_PATHER,
29-
30-
PATH_FIRST_PATH = 4755520,
31-
PATH_LAST_PATH = 4755552,
3229
};
3330

31+
static constexpr std::array<uint32, 5> PARTYGOER_PATHS = { 4755520, 4755528, 4755536, 4755544, 4755552 };
32+
3433
struct npc_partygoer_pather : public ScriptedAI
3534
{
36-
npc_partygoer_pather(Creature* creature) : ScriptedAI(creature), _path(PATH_FIRST_PATH) { }
35+
npc_partygoer_pather(Creature* creature) : ScriptedAI(creature), _path(PARTYGOER_PATHS.begin()) { }
3736

3837
void JustAppeared() override
3938
{
40-
_path = PATH_FIRST_PATH;
39+
_path = PARTYGOER_PATHS.begin();
4140
_events.ScheduleEvent(EVENT_RANDOM_ACTION_PATHER, 11s, 14s);
4241
}
4342

4443
void WaypointPathEnded(uint32 /*nodeId*/, uint32 /*pathId*/) override
4544
{
4645
++_path;
47-
if (_path > PATH_LAST_PATH)
48-
_path = PATH_FIRST_PATH;
46+
if (_path == PARTYGOER_PATHS.end())
47+
_path = PARTYGOER_PATHS.begin();
4948

5049
_events.ScheduleEvent(EVENT_RANDOM_ACTION_PATHER, 11s, 14s);
5150
}
@@ -59,7 +58,7 @@ struct npc_partygoer_pather : public ScriptedAI
5958
switch (eventId)
6059
{
6160
case EVENT_PATH:
62-
me->GetMotionMaster()->MovePath(_path, false);
61+
me->GetMotionMaster()->MovePath(*_path, false);
6362
break;
6463
case EVENT_RANDOM_ACTION_PATHER:
6564
{
@@ -110,7 +109,7 @@ struct npc_partygoer_pather : public ScriptedAI
110109

111110
private:
112111
EventMap _events;
113-
uint32 _path;
112+
std::array<uint32, 5>::const_iterator _path;
114113
};
115114

116115
enum Partygoer

0 commit comments

Comments
 (0)