diff --git a/src/game/game.cpp b/src/game/game.cpp index deb7f7388a4..ffa3af4c0a6 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -6134,7 +6134,7 @@ void Game::playerToggleMount(uint32_t playerId, bool mount) { player->toggleMount(mount); } -void Game::playerChangeOutfit(uint32_t playerId, Outfit_t outfit, uint8_t isMountRandomized /* = 0*/) { +void Game::playerChangeOutfit(uint32_t playerId, Outfit_t outfit, bool setMount, uint8_t isMountRandomized /* = 0*/) { if (!g_configManager().getBoolean(ALLOW_CHANGEOUTFIT)) { return; } @@ -6157,7 +6157,7 @@ void Game::playerChangeOutfit(uint32_t playerId, Outfit_t outfit, uint8_t isMoun } const auto playerOutfit = Outfits::getInstance().getOutfitByLookType(player, outfit.lookType); - if (!playerOutfit) { + if (!playerOutfit || !setMount) { outfit.lookMount = 0; } diff --git a/src/game/game.hpp b/src/game/game.hpp index 3fd5e6980e0..abc678908a2 100644 --- a/src/game/game.hpp +++ b/src/game/game.hpp @@ -387,7 +387,7 @@ class Game { void playerShowQuestLog(uint32_t playerId); void playerShowQuestLine(uint32_t playerId, uint16_t questId); void playerSay(uint32_t playerId, uint16_t channelId, SpeakClasses type, const std::string &receiver, const std::string &text); - void playerChangeOutfit(uint32_t playerId, Outfit_t outfit, uint8_t isMountRandomized = 0); + void playerChangeOutfit(uint32_t playerId, Outfit_t outfit, bool setMount, uint8_t isMountRandomized = 0); void playerInviteToParty(uint32_t playerId, uint32_t invitedId); void playerJoinParty(uint32_t playerId, uint32_t leaderId); void playerRevokePartyInvitation(uint32_t playerId, uint32_t invitedId); diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index 744a57e761b..99a94caffd6 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -1683,18 +1683,19 @@ void ProtocolGame::parseSetOutfit(NetworkMessage &msg) { newOutfit.lookAddons = msg.getByte(); if (outfitType == 0) { newOutfit.lookMount = msg.get(); + bool setMount = false; if (!oldProtocol) { newOutfit.lookMountHead = std::min(132, msg.getByte()); newOutfit.lookMountBody = std::min(132, msg.getByte()); newOutfit.lookMountLegs = std::min(132, msg.getByte()); newOutfit.lookMountFeet = std::min(132, msg.getByte()); - bool isMounted = msg.getByte(); + setMount = msg.getByte(); newOutfit.lookFamiliarsType = msg.get(); - g_logger().debug("Bool isMounted: {}", isMounted); + g_logger().debug("Bool isMounted: {}", setMount); } uint8_t isMountRandomized = !oldProtocol ? msg.getByte() : 0; - g_game().playerChangeOutfit(player->getID(), newOutfit, isMountRandomized); + g_game().playerChangeOutfit(player->getID(), newOutfit, setMount, isMountRandomized); } else if (outfitType == 1) { // This value probably has something to do with try outfit variable inside outfit window dialog // if try outfit is set to 2 it expects uint32_t value after mounted and disable mounts from outfit window dialog