Skip to content

Commit

Permalink
fix: mount bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas committed Feb 10, 2024
1 parent 5248cf0 commit b34cd14
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5645,16 +5645,18 @@ void Game::playerChangeOutfit(uint32_t playerId, Outfit_t outfit, uint8_t isMoun
outfit.lookMount = 0;
}

auto deltaSpeedChange = mount->speed;
if (player->isMounted()) {
const auto prevMount = mounts.getMountByID(player->getLastMount());
if (prevMount) {
deltaSpeedChange -= prevMount->speed;
if (g_configManager().getBoolean(TOGGLE_MOUNT_IN_PZ, __FUNCTION__) && !group->access) {
auto deltaSpeedChange = mount->speed;
if (player->isMounted()) {
const auto prevMount = mounts.getMountByID(player->getLastMount());
if (prevMount) {
deltaSpeedChange -= prevMount->speed;
}
}
}

player->setCurrentMount(mount->id);
changeSpeed(player, deltaSpeedChange);
player->setCurrentMount(mount->id);
changeSpeed(player, deltaSpeedChange);
}
} else if (player->isMounted()) {
player->dismount();
}
Expand Down

0 comments on commit b34cd14

Please sign in to comment.