Skip to content

Commit

Permalink
use deque instead of forward_list, it's faster.
Browse files Browse the repository at this point in the history
  • Loading branch information
mehah committed Oct 23, 2023
1 parent 6a62013 commit 54a0979
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion src/creatures/combat/combat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ void Combat::addDistanceEffect(std::shared_ptr<Creature> caster, const Position

void Combat::doChainEffect(const Position &origin, const Position &dest, uint8_t effect) {
if (effect > 0) {
std::forward_list<Direction> dirList;
std::deque<Direction> dirList;
FindPathParams fpp;
fpp.minTargetDist = 0;
fpp.maxTargetDist = 1;
Expand Down
4 changes: 2 additions & 2 deletions src/creatures/combat/condition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1929,7 +1929,7 @@ bool ConditionFeared::getFleeDirection(std::shared_ptr<Creature> creature) {
return false;
}

bool ConditionFeared::getFleePath(std::shared_ptr<Creature> creature, const Position &pos, std::forward_list<Direction> &dirList) {
bool ConditionFeared::getFleePath(std::shared_ptr<Creature> creature, const Position &pos, std::deque<Direction> &dirList) {
const std::vector<uint8_t> walkSize { 15, 9, 3, 1 };
bool found = false;
std::ptrdiff_t found_size = 0;
Expand Down Expand Up @@ -2030,7 +2030,7 @@ bool ConditionFeared::startCondition(std::shared_ptr<Creature> creature) {

bool ConditionFeared::executeCondition(std::shared_ptr<Creature> creature, int32_t interval) {
Position currentPos = creature->getPosition();
std::forward_list<Direction> listDir;
std::deque<Direction> listDir;

g_logger().debug("[ConditionFeared::executeCondition] Executing condition, current position is {}", currentPos.toString());

Expand Down
2 changes: 1 addition & 1 deletion src/creatures/combat/condition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ class ConditionFeared final : public Condition {
private:
bool canWalkTo(std::shared_ptr<Creature> creature, Position pos, Direction moveDirection) const;
bool getFleeDirection(std::shared_ptr<Creature> creature);
bool getFleePath(std::shared_ptr<Creature> creature, const Position &pos, std::forward_list<Direction> &dirList);
bool getFleePath(std::shared_ptr<Creature> creature, const Position &pos, std::deque<Direction> &dirList);
bool getRandomDirection(std::shared_ptr<Creature> creature, Position pos);
bool isStuck(std::shared_ptr<Creature> creature, Position pos) const;

Expand Down
12 changes: 6 additions & 6 deletions src/creatures/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ bool Creature::getNextStep(Direction &dir, uint32_t &) {
return true;
}

void Creature::startAutoWalk(const std::forward_list<Direction> &listDir, bool ignoreConditions /* = false*/) {
void Creature::startAutoWalk(const std::deque<Direction> &listDir, bool ignoreConditions /* = false*/) {
if (!ignoreConditions && (hasCondition(CONDITION_ROOTED) || hasCondition(CONDITION_FEARED))) {
return;
}
Expand Down Expand Up @@ -988,7 +988,7 @@ void Creature::goToFollowCreature() {
return; // cancel pathfinder
}

std::forward_list<Direction> list;
std::deque<Direction> list;
if (self->hasFollowPath = self->getPathTo(targetPos, list, fpp)) {
g_dispatcher().addEvent([self, list = std::move(list)] { self->startAutoWalk(list); }, "Creature::goToFollowCreature");
}
Expand All @@ -1014,14 +1014,14 @@ void Creature::goToFollowCreature() {
if (eventId != self->pathFinderEventId.load()) {
return; // cancel pathfinder
}
std::forward_list<Direction> list;
std::deque<Direction> list;
if (self->hasFollowPath = self->getPathTo(targetPos, list, fpp)) {
if (eventId != self->pathFinderEventId.load()) {
g_logger().info("canceled");
return; // cancel pathfinder
}

std::forward_list<Direction> list;
std::deque<Direction> list;

Check warning on line 1024 in src/creatures/creature.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

[cppcheck] src/creatures/creature.cpp#L1024

Local variable 'list' shadows outer variable
Raw output
src/creatures/creature.cpp:1024:Local variable 'list' shadows outer variable
if (self->hasFollowPath = self->getPathTo(targetPos, list, fpp)) {
g_dispatcher().addEvent([self, list = std::move(list)] { self->startAutoWalk(list); }, "Creature::goToFollowCreature");
}
Expand Down Expand Up @@ -1659,11 +1659,11 @@ bool Creature::isInvisible() const {
!= conditions.end();
}

bool Creature::getPathTo(const Position &targetPos, std::forward_list<Direction> &dirList, const FindPathParams &fpp) {
bool Creature::getPathTo(const Position &targetPos, std::deque<Direction> &dirList, const FindPathParams &fpp) {
return g_game().map.getPathMatching(getCreature(), dirList, FrozenPathingConditionCall(targetPos), fpp);
}

bool Creature::getPathTo(const Position &targetPos, std::forward_list<Direction> &dirList, int32_t minTargetDist, int32_t maxTargetDist, bool fullPathSearch /*= true*/, bool clearSight /*= true*/, int32_t maxSearchDist /*= 7*/) {
bool Creature::getPathTo(const Position &targetPos, std::deque<Direction> &dirList, int32_t minTargetDist, int32_t maxTargetDist, bool fullPathSearch /*= true*/, bool clearSight /*= true*/, int32_t maxSearchDist /*= 7*/) {
FindPathParams fpp;
fpp.fullPathSearch = fullPathSearch;
fpp.maxSearchDist = maxSearchDist;
Expand Down
8 changes: 4 additions & 4 deletions src/creatures/creature.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class Creature : virtual public Thing, public SharedObject {
phmap::flat_hash_set<std::shared_ptr<Zone>> getZones();

// walk functions
void startAutoWalk(const std::forward_list<Direction> &listDir, bool ignoreConditions = false);
void startAutoWalk(const std::deque<Direction> &listDir, bool ignoreConditions = false);
void addEventWalk(bool firstStep = false);
void stopEventWalk();
virtual void goToFollowCreature();
Expand Down Expand Up @@ -528,8 +528,8 @@ class Creature : virtual public Thing, public SharedObject {

double getDamageRatio(std::shared_ptr<Creature> attacker) const;

bool getPathTo(const Position &targetPos, std::forward_list<Direction> &dirList, const FindPathParams &fpp);
bool getPathTo(const Position &targetPos, std::forward_list<Direction> &dirList, int32_t minTargetDist, int32_t maxTargetDist, bool fullPathSearch = true, bool clearSight = true, int32_t maxSearchDist = 7);
bool getPathTo(const Position &targetPos, std::deque<Direction> &dirList, const FindPathParams &fpp);
bool getPathTo(const Position &targetPos, std::deque<Direction> &dirList, int32_t minTargetDist, int32_t maxTargetDist, bool fullPathSearch = true, bool clearSight = true, int32_t maxSearchDist = 7);

struct CountBlock_t {
int32_t total;
Expand Down Expand Up @@ -664,7 +664,7 @@ class Creature : virtual public Thing, public SharedObject {
CreatureEventList eventsList;
ConditionList conditions;

std::forward_list<Direction> listWalkDir;
std::deque<Direction> listWalkDir;

std::weak_ptr<Tile> m_tile;
std::weak_ptr<Creature> m_attackedCreature;
Expand Down
2 changes: 1 addition & 1 deletion src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7529,7 +7529,7 @@ SoundEffect_t Player::getAttackSoundEffect() const {
bool Player::canAutoWalk(const Position &toPosition, const std::function<void()> &function, uint32_t delay /* = 500*/) {
if (!Position::areInRange<1, 1>(getPosition(), toPosition)) {
// Check if can walk to the toPosition and send event to use function
std::forward_list<Direction> listDir;
std::deque<Direction> listDir;
if (getPathTo(toPosition, listDir, 0, 1, true, true)) {
g_dispatcher().addEvent(std::bind(&Game::playerAutoWalk, &g_game(), getID(), listDir), __FUNCTION__);

Expand Down
38 changes: 19 additions & 19 deletions src/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,7 @@ void Game::playerMoveCreature(std::shared_ptr<Player> player, std::shared_ptr<Cr

if (!Position::areInRange<1, 1, 0>(movingCreatureOrigPos, player->getPosition())) {
// need to walk to the creature first before moving it
std::forward_list<Direction> listDir;
std::deque<Direction> listDir;
if (player->getPathTo(movingCreatureOrigPos, listDir, 0, 1, true, true)) {
g_dispatcher().addEvent(std::bind(&Game::playerAutoWalk, this, player->getID(), listDir), "Game::playerAutoWalk");

Expand Down Expand Up @@ -1439,7 +1439,7 @@ void Game::playerMoveItem(std::shared_ptr<Player> player, const Position &fromPo

if (!Position::areInRange<1, 1>(playerPos, mapFromPos)) {
// need to walk to the item first before using it
std::forward_list<Direction> listDir;
std::deque<Direction> listDir;
if (player->getPathTo(item->getPosition(), listDir, 0, 1, true, true)) {
g_dispatcher().addEvent(std::bind(&Game::playerAutoWalk, this, player->getID(), listDir), "Game::playerAutoWalk");

Expand Down Expand Up @@ -1496,7 +1496,7 @@ void Game::playerMoveItem(std::shared_ptr<Player> player, const Position &fromPo
internalGetPosition(moveItem, itemPos, itemStackPos);
}

std::forward_list<Direction> listDir;
std::deque<Direction> listDir;
if (player->getPathTo(walkPos, listDir, 0, 0, true, true)) {
g_dispatcher().addEvent(std::bind(&Game::playerAutoWalk, this, player->getID(), listDir), "Game::playerAutoWalk");

Expand Down Expand Up @@ -3018,7 +3018,7 @@ void Game::playerMove(uint32_t playerId, Direction direction) {
player->setNextWalkActionTask(nullptr);
player->cancelPush();

player->startAutoWalk(std::forward_list<Direction> { direction }, false);
player->startAutoWalk(std::deque<Direction> { direction }, false);
}

void Game::forcePlayerMove(uint32_t playerId, Direction direction) {
Expand All @@ -3031,7 +3031,7 @@ void Game::forcePlayerMove(uint32_t playerId, Direction direction) {
player->setNextWalkActionTask(nullptr);
player->cancelPush();

player->startAutoWalk(std::forward_list<Direction> { direction }, true);
player->startAutoWalk(std::deque<Direction> { direction }, true);
}

bool Game::playerBroadcastMessage(std::shared_ptr<Player> player, const std::string &text) const {
Expand Down Expand Up @@ -3196,7 +3196,7 @@ void Game::playerReceivePingBack(uint32_t playerId) {
player->sendPingBack();
}

void Game::playerAutoWalk(uint32_t playerId, const std::forward_list<Direction> &listDir) {
void Game::playerAutoWalk(uint32_t playerId, const std::deque<Direction> &listDir) {
std::shared_ptr<Player> player = getPlayerByID(playerId);
if (!player) {
return;
Expand All @@ -3207,7 +3207,7 @@ void Game::playerAutoWalk(uint32_t playerId, const std::forward_list<Direction>
player->startAutoWalk(listDir, false);
}

void Game::forcePlayerAutoWalk(uint32_t playerId, const std::forward_list<Direction> &listDir) {
void Game::forcePlayerAutoWalk(uint32_t playerId, const std::deque<Direction> &listDir) {
std::shared_ptr<Player> player = getPlayerByID(playerId);
if (!player) {
return;
Expand Down Expand Up @@ -3296,7 +3296,7 @@ void Game::playerUseItemEx(uint32_t playerId, const Position &fromPos, uint8_t f
internalGetPosition(moveItem, itemPos, itemStackPos);
}

std::forward_list<Direction> listDir;
std::deque<Direction> listDir;
if (player->getPathTo(walkToPos, listDir, 0, 1, true, true)) {
g_dispatcher().addEvent(std::bind(&Game::playerAutoWalk, this, player->getID(), listDir), "Game::playerAutoWalk");

Expand Down Expand Up @@ -3401,7 +3401,7 @@ void Game::playerUseItem(uint32_t playerId, const Position &pos, uint8_t stackPo
ReturnValue ret = g_actions().canUse(player, pos);
if (ret != RETURNVALUE_NOERROR) {
if (ret == RETURNVALUE_TOOFARAWAY) {
std::forward_list<Direction> listDir;
std::deque<Direction> listDir;
if (player->getPathTo(pos, listDir, 0, 1, true, true)) {
g_dispatcher().addEvent(std::bind(&Game::playerAutoWalk, this, player->getID(), listDir), "Game::playerAutoWalk");

Expand Down Expand Up @@ -3535,7 +3535,7 @@ void Game::playerUseWithCreature(uint32_t playerId, const Position &fromPos, uin
internalGetPosition(moveItem, itemPos, itemStackPos);
}

std::forward_list<Direction> listDir;
std::deque<Direction> listDir;
if (player->getPathTo(walkToPos, listDir, 0, 1, true, true)) {
g_dispatcher().addEvent(std::bind(&Game::playerAutoWalk, this, player->getID(), listDir), "Game::playerAutoWalk");

Expand Down Expand Up @@ -3674,7 +3674,7 @@ void Game::playerRotateItem(uint32_t playerId, const Position &pos, uint8_t stac
}

if (pos.x != 0xFFFF && !Position::areInRange<1, 1, 0>(pos, player->getPosition())) {
std::forward_list<Direction> listDir;
std::deque<Direction> listDir;
if (player->getPathTo(pos, listDir, 0, 1, true, true)) {
g_dispatcher().addEvent(std::bind(&Game::playerAutoWalk, this, player->getID(), listDir), "Game::playerAutoWalk");

Expand Down Expand Up @@ -3715,7 +3715,7 @@ void Game::playerConfigureShowOffSocket(uint32_t playerId, const Position &pos,

bool isPodiumOfRenown = itemId == ITEM_PODIUM_OF_RENOWN1 || itemId == ITEM_PODIUM_OF_RENOWN2;
if (!Position::areInRange<1, 1, 0>(pos, player->getPosition())) {
std::forward_list<Direction> listDir;
std::deque<Direction> listDir;
if (player->getPathTo(pos, listDir, 0, 1, true, false)) {
g_dispatcher().addEvent(std::bind(&Game::playerAutoWalk, this, player->getID(), listDir), "Game::playerAutoWalk");
std::shared_ptr<Task> task;
Expand Down Expand Up @@ -3762,7 +3762,7 @@ void Game::playerSetShowOffSocket(uint32_t playerId, Outfit_t &outfit, const Pos
}

if (!Position::areInRange<1, 1, 0>(pos, player->getPosition())) {
std::forward_list<Direction> listDir;
std::deque<Direction> listDir;
if (player->getPathTo(pos, listDir, 0, 1, true, false)) {
g_dispatcher().addEvent(std::bind(&Game::playerAutoWalk, this, player->getID(), listDir), "Game::playerAutoWalk");
std::shared_ptr<Task> task = createPlayerTask(400, std::bind(&Game::playerBrowseField, this, playerId, pos), "Game::playerBrowseField");
Expand Down Expand Up @@ -3891,7 +3891,7 @@ void Game::playerWrapableItem(uint32_t playerId, const Position &pos, uint8_t st
}

if (pos.x != 0xFFFF && !Position::areInRange<1, 1, 0>(pos, player->getPosition())) {
std::forward_list<Direction> listDir;
std::deque<Direction> listDir;
if (player->getPathTo(pos, listDir, 0, 1, true, true)) {
g_dispatcher().addEvent(std::bind(&Game::playerAutoWalk, this, player->getID(), listDir), "Game::playerAutoWalk");

Expand Down Expand Up @@ -4061,7 +4061,7 @@ void Game::playerBrowseField(uint32_t playerId, const Position &pos) {
}

if (!Position::areInRange<1, 1>(playerPos, pos)) {
std::forward_list<Direction> listDir;
std::deque<Direction> listDir;
if (player->getPathTo(pos, listDir, 0, 1, true, true)) {
g_dispatcher().addEvent(std::bind(&Game::playerAutoWalk, this, player->getID(), listDir), "Game::playerAutoWalk");
std::shared_ptr<Task> task = createPlayerTask(400, std::bind(&Game::playerBrowseField, this, playerId, pos), "Game::playerBrowseField");
Expand Down Expand Up @@ -4311,7 +4311,7 @@ void Game::playerRequestTrade(uint32_t playerId, const Position &pos, uint8_t st
}

if (!Position::areInRange<1, 1>(tradeItemPosition, playerPosition)) {
std::forward_list<Direction> listDir;
std::deque<Direction> listDir;
if (player->getPathTo(pos, listDir, 0, 1, true, true)) {
g_dispatcher().addEvent(std::bind(&Game::playerAutoWalk, this, player->getID(), listDir), "Game::playerAutoWalk");

Expand Down Expand Up @@ -4860,7 +4860,7 @@ void Game::playerQuickLoot(uint32_t playerId, const Position &pos, uint16_t item
if (!autoLoot && pos.x != 0xffff) {
if (!Position::areInRange<1, 1, 0>(pos, player->getPosition())) {
// need to walk to the corpse first before looting it
std::forward_list<Direction> listDir;
std::deque<Direction> listDir;
if (player->getPathTo(pos, listDir, 0, 1, true, true)) {
g_dispatcher().addEvent(std::bind(&Game::playerAutoWalk, this, player->getID(), listDir), "Game::playerAutoWalk");
std::shared_ptr<Task> task = createPlayerTask(0, std::bind(&Game::playerQuickLoot, this, player->getID(), pos, itemId, stackPos, defaultItem, lootAllCorpses, autoLoot), "Game::playerQuickLoot");
Expand Down Expand Up @@ -9003,7 +9003,7 @@ void Game::playerSetMonsterPodium(uint32_t playerId, uint32_t monsterRaceId, con
}

if (!Position::areInRange<1, 1, 0>(pos, player->getPosition())) {
if (std::forward_list<Direction> listDir;
if (std::deque<Direction> listDir;
player->getPathTo(pos, listDir, 0, 1, true, false)) {
g_dispatcher().addEvent(std::bind_front(&Game::playerAutoWalk, this, player->getID(), listDir), "Game::playerAutoWalk");
std::shared_ptr<Task> task = createPlayerTask(400, std::bind_front(&Game::playerBrowseField, this, playerId, pos), "Game::playerBrowseField");
Expand Down Expand Up @@ -9094,7 +9094,7 @@ void Game::playerRotatePodium(uint32_t playerId, const Position &pos, uint8_t st
}

if (pos.x != 0xFFFF && !Position::areInRange<1, 1, 0>(pos, player->getPosition())) {
if (std::forward_list<Direction> listDir;
if (std::deque<Direction> listDir;
player->getPathTo(pos, listDir, 0, 1, true, true)) {
g_dispatcher().addEvent(std::bind_front(&Game::playerAutoWalk, this, player->getID(), listDir), "Game::playerAutoWalk");

Expand Down
4 changes: 2 additions & 2 deletions src/game/game.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ class Game {
void playerCloseNpcChannel(uint32_t playerId);
void playerReceivePing(uint32_t playerId);
void playerReceivePingBack(uint32_t playerId);
void playerAutoWalk(uint32_t playerId, const std::forward_list<Direction> &listDir);
void forcePlayerAutoWalk(uint32_t playerId, const std::forward_list<Direction> &listDir);
void playerAutoWalk(uint32_t playerId, const std::deque<Direction> &listDir);
void forcePlayerAutoWalk(uint32_t playerId, const std::deque<Direction> &listDir);
void playerStopAutoWalk(uint32_t playerId);
void playerUseItemEx(uint32_t playerId, const Position &fromPos, uint8_t fromStackPos, uint16_t fromItemId, const Position &toPos, uint8_t toStackPos, uint16_t toItemId);
void playerUseItem(uint32_t playerId, const Position &pos, uint8_t stackPos, uint8_t index, uint16_t itemId);
Expand Down
2 changes: 1 addition & 1 deletion src/lua/functions/creatures/creature_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ int CreatureFunctions::luaCreatureGetPathTo(lua_State* L) {
fpp.clearSight = getBoolean(L, 6, fpp.clearSight);
fpp.maxSearchDist = getNumber<int32_t>(L, 7, fpp.maxSearchDist);

std::forward_list<Direction> dirList;
std::deque<Direction> dirList;
if (creature->getPathTo(position, dirList, fpp)) {
lua_newtable(L);

Expand Down
2 changes: 1 addition & 1 deletion src/lua/functions/map/position_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ int PositionFunctions::luaPositionGetPathTo(lua_State* L) {
fpp.clearSight = getBoolean(L, 6, fpp.clearSight);
fpp.maxSearchDist = getNumber<int32_t>(L, 7, fpp.maxSearchDist);

std::forward_list<Direction> dirList;
std::deque<Direction> dirList;
if (g_game().map.getPathMatching(pos, dirList, FrozenPathingConditionCall(position), fpp)) {
lua_newtable(L);

Expand Down
4 changes: 2 additions & 2 deletions src/map/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,11 +510,11 @@ std::shared_ptr<Tile> Map::canWalkTo(const std::shared_ptr<Creature> &creature,
return tile;
}

bool Map::getPathMatching(const std::shared_ptr<Creature> &creature, std::forward_list<Direction> &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp) {
bool Map::getPathMatching(const std::shared_ptr<Creature> &creature, std::deque<Direction> &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp) {
return getPathMatching(creature, creature->getPosition(), dirList, pathCondition, fpp);
}

bool Map::getPathMatching(const std::shared_ptr<Creature> &creature, const Position &startPos, std::forward_list<Direction> &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp) {
bool Map::getPathMatching(const std::shared_ptr<Creature> &creature, const Position &startPos, std::deque<Direction> &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp) {
static int_fast32_t allNeighbors[8][2] = {
{ -1, 0 }, { 0, 1 }, { 1, 0 }, { 0, -1 }, { -1, -1 }, { 1, -1 }, { 1, 1 }, { -1, 1 }
};
Expand Down
6 changes: 3 additions & 3 deletions src/map/map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ class Map : protected MapCache {

std::shared_ptr<Tile> canWalkTo(const std::shared_ptr<Creature> &creature, const Position &pos);

bool getPathMatching(const std::shared_ptr<Creature> &creature, std::forward_list<Direction> &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp);
bool getPathMatching(const std::shared_ptr<Creature> &creature, std::deque<Direction> &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp);

bool getPathMatching(const Position &startPos, std::forward_list<Direction> &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp) {
bool getPathMatching(const Position &startPos, std::deque<Direction> &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp) {
return getPathMatching(nullptr, startPos, dirList, pathCondition, fpp);
}

Expand All @@ -147,7 +147,7 @@ class Map : protected MapCache {
Houses housesCustomMaps[50];

private:
bool getPathMatching(const std::shared_ptr<Creature> &creature, const Position &startPos, std::forward_list<Direction> &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp);
bool getPathMatching(const std::shared_ptr<Creature> &creature, const Position &startPos, std::deque<Direction> &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp);

/**
* Set a single tile.
Expand Down
2 changes: 1 addition & 1 deletion src/server/network/protocol/protocolgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ void ProtocolGame::parseAutoWalk(NetworkMessage &msg) {

msg.skipBytes(numdirs);

std::forward_list<Direction> path;
std::deque<Direction> path;
for (uint8_t i = 0; i < numdirs; ++i) {
uint8_t rawdir = msg.getPreviousByte();
switch (rawdir) {
Expand Down

0 comments on commit 54a0979

Please sign in to comment.