From f1b3761b31dcf6cf9bcef5fddf55730e3c36fdcb Mon Sep 17 00:00:00 2001 From: seefo Date: Wed, 13 Mar 2019 19:46:34 -0400 Subject: [PATCH] Added ability to not perform LOS checks if a target object has the skipLosCheck objvar --- .../serverGame/src/shared/object/CreatureObject.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp b/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp index 9f8ce19e..9eaf0211 100755 --- a/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp +++ b/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp @@ -240,6 +240,9 @@ const std::string OBJVAR_PLAYER_HOUSE_ID("residenceHouseId"); static const unsigned MAX_ATTEMPTS_TO_REMOVE_PET_FROM_GROUP = 30; static const int TIME_BETWEEN_ATTEMPTS_TO_REMOVE_PET = 1; +// used to determine if LOS-checks should be skipped during CreatureObject::canManipulateObject +static const std::string OBJVAR_SKIP_LOS_CHECK("skipLosCheck"); + // creature regen constants const static std::string CREATURES_TABLE("datatables/mob/creatures.iff"); @@ -1458,11 +1461,11 @@ bool CreatureObject::canManipulateObject(ServerObject const &target, bool moving } } - // skip LOS check if the item is being restored as part of decoration layout restore + // skip LOS check if the item is being restored as part of decoration layout restore or if it has the skipLOS objvar PlayerObject const * const playerObject = PlayerCreatureController::getPlayerObject(this); if (!playerObject || (playerObject->getRestoreDecorationObjectBeingRestored() != target.getNetworkId())) { - if (!checkLOSTo(*firstParentInWorld)) + if (!target.getObjVars().hasItem(OBJVAR_SKIP_LOS_CHECK) && !checkLOSTo(*firstParentInWorld)) { code = Container::CEC_CantSee; // DEBUG_REPORT_LOG(true, ("LOS check failed in can manipulate\n"));