From 4d04072672af14ce5f86820fcb0595dab1611016 Mon Sep 17 00:00:00 2001 From: Pavol Marko Date: Sat, 18 Sep 2004 13:37:46 +0000 Subject: [PATCH] Added MF_Prepare*ArrayA functions The MF_Prepare*ArrayA functions have a third "bool copyBack" parameter which defaults to false and specifies whether the array should be copied from plugin space to module space after function execution (=whether the original array should be updated) The MF_Prepare*Array are equivalent to MF_Prepare*ArrayA(ptr, size, false); --- amxmodx/modules.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/amxmodx/modules.cpp b/amxmodx/modules.cpp index d837d94c..dcb4f8ba 100755 --- a/amxmodx/modules.cpp +++ b/amxmodx/modules.cpp @@ -1270,6 +1270,18 @@ void MNF_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons } #endif +// 09/18/2004 : added these two funcs that default to copyBack=false so we don't break all modules +cell MNF_PrepareCellArray(cell *ptr, unsigned int size) +{ + return prepareCellArray(ptr, size, false); +} + +cell MNF_PrepareCharArray(char *ptr, unsigned int size) +{ + return prepareCharArray(ptr, size, false); +} + + // Fnptr Request function for the new interface const char *g_LastRequestedFunc = NULL; #define REGISTER_FUNC(name, func) { name, (void*)func }, @@ -1322,8 +1334,10 @@ void *Module_ReqFnptr(const char *funcName) REGISTER_FUNC("RegisterSPForwardByName", registerSPForwardByName) REGISTER_FUNC("UnregisterSPForward", unregisterSPForward) REGISTER_FUNC("ExecuteForward", executeForwards) - REGISTER_FUNC("PrepareCellArray", prepareCellArray) - REGISTER_FUNC("PrepareCharArray", prepareCharArray) + REGISTER_FUNC("PrepareCellArray", MNF_PrepareCellArray) + REGISTER_FUNC("PrepareCharArray", MNF_PrepareCharArray) + REGISTER_FUNC("PrepareCellArrayA", prepareCellArray) + REGISTER_FUNC("PrepareCharArrayA", prepareCharArray) // Player REGISTER_FUNC("GetPlayerFlags", MNF_GetPlayerFlags)