Suppress deletion fail warning if script blocks deletion

This commit is contained in:
Aconite
2021-01-20 20:25:22 -05:00
committed by GitHub
parent ad57ec13b4
commit 77265bf5bf
@@ -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()
{
}
// ======================================================================
// ======================================================================