Skip to content

Commit

Permalink
Improvement of teleportTo function log (#466)
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas authored Aug 1, 2022
1 parent 5a6da6c commit 1f07781
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions src/lua/functions/creatures/creature_functions.cpp
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
/**
* Canary - A free and open-source MMORPG server emulator
* Copyright (C) 2021 OpenTibiaBR <opentibiabr@outlook.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
* Copyright (©) 2019-2022 OpenTibiaBR <opentibiabr@outlook.com>
* Repository: https://github.com/opentibiabr/canary
* License: https://github.com/opentibiabr/canary/blob/main/LICENSE
* Contributors: https://github.com/opentibiabr/canary/graphs/contributors
* Website: https://docs.opentibiabr.org/
*/

#include "otpch.h"

#include <boost/range/adaptor/reversed.hpp>

#include "game/game.h"
#include "creatures/creature.h"
#include "lua/functions/creatures/creature_functions.hpp"
Expand Down Expand Up @@ -763,7 +751,7 @@ int CreatureFunctions::luaCreatureTeleportTo(lua_State* L) {

const Position oldPosition = creature->getPosition();
if (g_game().internalTeleport(creature, position, pushMovement) != RETURNVALUE_NOERROR) {
reportErrorFunc("Could not teleport creature.");
SPDLOG_WARN("[{}] - Cannot teleport creature with name: {}, fromPosition {}, toPosition {}", __FUNCTION__, creature->getName(), oldPosition.toString(), position.toString());
pushBoolean(L, false);
return 1;
}
Expand Down

0 comments on commit 1f07781

Please sign in to comment.