Skip to content

Commit

Permalink
* Fix npc crash
Browse files Browse the repository at this point in the history
  • Loading branch information
jprzimba committed Jan 12, 2025
1 parent 05d55db commit f5c4d92
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/creatures/npcs/npc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,13 +828,13 @@ void Npc::removeShopPlayer(uint32_t playerGUID) {
}

void Npc::closeAllShopWindows() {
for (const auto &playerGUID : shopPlayers | std::views::keys) {
const auto &player = g_game().getPlayerByGUID(playerGUID);
for (auto it = shopPlayers.begin(); it != shopPlayers.end();) {
const auto &player = g_game().getPlayerByGUID(it->first);
if (player) {
player->closeShopWindow();
}
it = shopPlayers.erase(it);
}
shopPlayers.clear();
}

void Npc::handlePlayerMove(const std::shared_ptr<Player> &player, const Position &newPos) {
Expand Down

0 comments on commit f5c4d92

Please sign in to comment.