diff --git a/data-canary/scripts/actions/other/ladder_up.lua b/data-canary/scripts/actions/other/ladder_up.lua index efea920c9b8..80d811fa741 100644 --- a/data-canary/scripts/actions/other/ladder_up.lua +++ b/data-canary/scripts/actions/other/ladder_up.lua @@ -14,7 +14,7 @@ function ladder.onUse(player, item, fromPosition, target, toPosition, isHotkey) return true end - player:teleportTo(fromPosition, false) + player:teleportTo(fromPosition, true) return true end diff --git a/data-otservbr-global/scripts/quests/the_hidden_city_of_beregar/actions_ladder.lua b/data-otservbr-global/scripts/quests/the_hidden_city_of_beregar/actions_ladder.lua index 5260bc4469a..83074b595e3 100644 --- a/data-otservbr-global/scripts/quests/the_hidden_city_of_beregar/actions_ladder.lua +++ b/data-otservbr-global/scripts/quests/the_hidden_city_of_beregar/actions_ladder.lua @@ -1,7 +1,7 @@ local dwarvenLadder = Action() function dwarvenLadder.onUse(player, item, fromPosition, itemEx, toPosition) if player:getStorageValue(Storage.DwarvenLegs) < 1 then - player:teleportTo({ x = 32681, y = 31507, z = 10 }) + player:teleportTo({ x = 32681, y = 31507, z = 10 }, true) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) return true else diff --git a/src/creatures/combat/combat.cpp b/src/creatures/combat/combat.cpp index 823d94ab519..34a28398e9e 100644 --- a/src/creatures/combat/combat.cpp +++ b/src/creatures/combat/combat.cpp @@ -1089,7 +1089,7 @@ bool Combat::doCombatChain(const std::shared_ptr &caster, const std::s auto delay = i * std::max(50, g_configManager().getNumber(COMBAT_CHAIN_DELAY)); ++i; for (const auto &to : toVector) { - auto nextTarget = g_game().getCreatureByID(to); + const auto &nextTarget = g_game().getCreatureByID(to); if (!nextTarget) { continue; } diff --git a/src/game/game.cpp b/src/game/game.cpp index 79b96b697cd..50dcf29ca48 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -1419,7 +1419,7 @@ void Game::playerMoveCreatureByID(uint32_t playerId, uint32_t movingCreatureId, return; } - std::shared_ptr movingCreature = getCreatureByID(movingCreatureId); + const auto &movingCreature = getCreatureByID(movingCreatureId); if (!movingCreature) { return; } @@ -5451,7 +5451,7 @@ void Game::playerLookInBattleList(uint32_t playerId, uint32_t creatureId) { return; } - std::shared_ptr creature = getCreatureByID(creatureId); + const auto &creature = getCreatureByID(creatureId); if (!creature) { return; } @@ -5863,7 +5863,7 @@ void Game::playerSetAttackedCreature(uint32_t playerId, uint32_t creatureId) { return; } - std::shared_ptr attackCreature = getCreatureByID(creatureId); + const auto &attackCreature = getCreatureByID(creatureId); if (!attackCreature) { player->setAttackedCreature(nullptr); player->sendCancelTarget(); @@ -9424,7 +9424,7 @@ void Game::parsePlayerExtendedOpcode(uint32_t playerId, uint8_t opcode, const st } void Game::forceRemoveCondition(uint32_t creatureId, ConditionType_t conditionType, ConditionId_t conditionId) { - std::shared_ptr creature = getCreatureByID(creatureId); + const auto &creature = getCreatureByID(creatureId); if (!creature) { return; } diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index 466a2413353..ac43b589392 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -1522,7 +1522,7 @@ void ProtocolGame::checkCreatureAsKnown(uint32_t id, bool &known, uint32_t &remo continue; } // We need to protect party players from removing - std::shared_ptr creature = g_game().getCreatureByID(*it); + const auto &creature = g_game().getCreatureByID(*it); if (std::shared_ptr checkPlayer; creature && (checkPlayer = creature->getPlayer()) != nullptr) { if (player->getParty() != checkPlayer->getParty() && !canSee(creature)) {