From 77265bf5bff10d6a57514f89373464cc184dddc2 Mon Sep 17 00:00:00 2001 From: Aconite <63141077+AconiteGodOfSWG@users.noreply.github.com> Date: Wed, 20 Jan 2021 20:25:22 -0500 Subject: [PATCH] Suppress deletion fail warning if script blocks deletion --- .../serverGame/src/shared/command/CommandCppFuncs.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/engine/server/library/serverGame/src/shared/command/CommandCppFuncs.cpp b/engine/server/library/serverGame/src/shared/command/CommandCppFuncs.cpp index 435040bf..d3ffeafe 100755 --- a/engine/server/library/serverGame/src/shared/command/CommandCppFuncs.cpp +++ b/engine/server/library/serverGame/src/shared/command/CommandCppFuncs.cpp @@ -6739,7 +6739,13 @@ static void commandFuncServerDestroyObject(Command const &, NetworkId const & ac Chat::sendSystemMessage(*player, pp); } else + { + // don't throw a warning if the only reason destruction failed is because the no destroy script blocked the request + if (targetObject->getScriptObject()->hasScript("item.special.nodestroy")) { + return; + } WARNING(true, ("commandFuncServerDestroyObject: Error encountered while deleting object %s", target.getValueString().c_str())); + } } // ---------------------------------------------------------------------- @@ -9822,4 +9828,4 @@ void CommandCppFuncs::remove() { } -// ====================================================================== \ No newline at end of file +// ======================================================================