Merge pull request #672 from peace-maker/null_natives_fixed

Add natives to check for NULL_VECTOR and NULL_STRING
This commit is contained in:
Asher Baker
2017-10-27 20:03:09 +01:00
committed by GitHub
8 changed files with 348 additions and 19 deletions
+12 -2
View File
@@ -50,7 +50,7 @@
using namespace SourcePawn;
#define SMINTERFACE_FORWARDMANAGER_NAME "IForwardManager"
#define SMINTERFACE_FORWARDMANAGER_VERSION 3
#define SMINTERFACE_FORWARDMANAGER_VERSION 4
/*
* There is some very important documentation at the bottom of this file.
@@ -118,6 +118,7 @@ namespace SourceMod
cell_t val;
ByrefInfo byref;
ParamType pushedas;
bool isnull;
};
class IForwardFilter
@@ -177,12 +178,21 @@ namespace SourceMod
* @brief Pushes an array of cells onto the current call. Different rules than ICallable.
* NOTE: On Execute, the pointer passed will be modified according to the copyback rule.
*
* @param inarray Array to copy. Cannot be NULL, unlike ICallable's version.
* @param inarray Array to copy. If NULL and cells is 3 pushes a reference to the NULL_VECTOR pubvar to each callee.
* Pushing other number of cells is not allowed, unlike ICallable's version.
* @param cells Number of cells to allocate and optionally read from the input array.
* @param flags Whether or not changes should be copied back to the input array.
* @return Error code, if any.
*/
virtual int PushArray(cell_t *inarray, unsigned int cells, int flags=0) =0;
/**
* @brief Pushes a string onto the current call.
*
* @param string String to push. If NULL pushes a reference to the NULL_STRING pubvar to each callee.
* @return Error code, if any.
*/
virtual int PushString(const char *string) = 0;
};
/**