I was looking at the
API page and I noticed it says this:
To call a protected function, you must use the following code :
Lua Code:
if IsProtectedFunction("TheNameOfYourFunction") then CallSecureProtected("TheNameOfYourFunction", arg1, arg2, arg3) else TheNameOfYourFunction(arg1, arg2, arg3) end
|
However in the past I've simply just used CallSecureProtected without checking IsProtectedFunction first (specifically when I used
RequestMoveItem in
Restock Bank Materials) and I haven't run into issues or had any reported. But it says on the API page you "
must" use that first form, in bold and everything. Out of curiosity, what exactly is the benefit of doing so? Is it just for forward compatibility in case they un-protect an API function in the future, or is there another reason?