Update spcomp and includes to latest 1.10-fork

disable warning 241: Array-based enum structs will be removed in 1.11
This commit is contained in:
BotoX
2024-06-21 06:55:55 +02:00
committed by zaCade
parent 689c4e89cf
commit 917ec936f8
72 changed files with 7755 additions and 6440 deletions
+47 -38
View File
@@ -35,23 +35,23 @@
#endif
#define _commandfilters_included
#define MAX_TARGET_LENGTH 64
#define MAX_TARGET_LENGTH 64
#define COMMAND_FILTER_ALIVE (1<<0) /**< Only allow alive players */
#define COMMAND_FILTER_DEAD (1<<1) /**< Only filter dead players */
#define COMMAND_FILTER_CONNECTED (1<<2) /**< Allow players not fully in-game */
#define COMMAND_FILTER_NO_IMMUNITY (1<<3) /**< Ignore immunity rules */
#define COMMAND_FILTER_NO_MULTI (1<<4) /**< Do not allow multiple target patterns */
#define COMMAND_FILTER_NO_BOTS (1<<5) /**< Do not allow bots to be targetted */
#define COMMAND_FILTER_ALIVE (1<<0) /**< Only allow alive players */
#define COMMAND_FILTER_DEAD (1<<1) /**< Only filter dead players */
#define COMMAND_FILTER_CONNECTED (1<<2) /**< Allow players not fully in-game */
#define COMMAND_FILTER_NO_IMMUNITY (1<<3) /**< Ignore immunity rules */
#define COMMAND_FILTER_NO_MULTI (1<<4) /**< Do not allow multiple target patterns */
#define COMMAND_FILTER_NO_BOTS (1<<5) /**< Do not allow bots to be targetted */
#define COMMAND_TARGET_NONE 0 /**< No target was found */
#define COMMAND_TARGET_NOT_ALIVE -1 /**< Single client is not alive */
#define COMMAND_TARGET_NOT_DEAD -2 /**< Single client is not dead */
#define COMMAND_TARGET_NOT_IN_GAME -3 /**< Single client is not in game */
#define COMMAND_TARGET_IMMUNE -4 /**< Single client is immune */
#define COMMAND_TARGET_EMPTY_FILTER -5 /**< A multi-filter (such as @all) had no targets */
#define COMMAND_TARGET_NOT_HUMAN -6 /**< Target was not human */
#define COMMAND_TARGET_AMBIGUOUS -7 /**< Partial name had too many targets */
#define COMMAND_TARGET_NONE 0 /**< No target was found */
#define COMMAND_TARGET_NOT_ALIVE -1 /**< Single client is not alive */
#define COMMAND_TARGET_NOT_DEAD -2 /**< Single client is not dead */
#define COMMAND_TARGET_NOT_IN_GAME -3 /**< Single client is not in game */
#define COMMAND_TARGET_IMMUNE -4 /**< Single client is immune */
#define COMMAND_TARGET_EMPTY_FILTER -5 /**< A multi-filter (such as @all) had no targets */
#define COMMAND_TARGET_NOT_HUMAN -6 /**< Target was not human */
#define COMMAND_TARGET_AMBIGUOUS -7 /**< Partial name had too many targets */
/**
* Processes a generic command target string, and resolves it to a list
@@ -61,28 +61,28 @@
* as that file is guaranteed to contain all of the translatable phrases that
* ProcessTargetString() will return.
*
* @param pattern Pattern to find clients against.
* @param admin Admin performing the action, or 0 if the server.
* @param targets Array to hold targets.
* @param max_targets Maximum size of the targets array.
* @param filter_flags Filter flags.
* @param target_name Buffer to store the target name.
* @param tn_maxlength Maximum length of the target name buffer.
* @param tn_is_ml OUTPUT: Will be true if the target name buffer is an ML phrase,
* false if it is a normal string.
* @return If a multi-target pattern was used, the number of clients found
* is returned. If a single-target pattern was used, 1 is returned
* if one valid client is found. Otherwise, a COMMAND_TARGET reason
* for failure is returned.
* @param pattern Pattern to find clients against.
* @param admin Admin performing the action, or 0 if the server.
* @param targets Array to hold targets.
* @param max_targets Maximum size of the targets array.
* @param filter_flags Filter flags.
* @param target_name Buffer to store the target name.
* @param tn_maxlength Maximum length of the target name buffer.
* @param tn_is_ml OUTPUT: Will be true if the target name buffer is an ML phrase,
* false if it is a normal string.
* @return If a multi-target pattern was used, the number of clients found
* is returned. If a single-target pattern was used, 1 is returned
* if one valid client is found. Otherwise, a COMMAND_TARGET reason
* for failure is returned.
*/
native int ProcessTargetString(const char[] pattern,
int admin,
int[] targets,
int max_targets,
int filter_flags,
char[] target_name,
int tn_maxlength,
bool &tn_is_ml);
int admin,
int[] targets,
int max_targets,
int filter_flags,
char[] target_name,
int tn_maxlength,
bool &tn_is_ml);
/**
@@ -109,8 +109,8 @@ native void GetLastProcessTargetString(char[] pattern,
*
* Note: The translation phrases are found in common.phrases.txt.
*
* @param client Client index, or 0 for server.
* @param reason COMMAND_TARGET reason.
* @param client Client index, or 0 for server.
* @param reason COMMAND_TARGET reason.
*/
stock void ReplyToTargetError(int client, int reason, bool dynamic=true)
{
@@ -179,6 +179,8 @@ stock void ReplyToTargetError(int client, int reason, bool dynamic=true)
}
}
#define FEATURECAP_MULTITARGETFILTER_CLIENTPARAM "SourceMod MultiTargetFilter ClientParam"
/**
* Adds clients to a multi-target filter.
*
@@ -186,8 +188,15 @@ stock void ReplyToTargetError(int client, int reason, bool dynamic=true)
* @param clients Array to fill with unique, valid client indexes.
* @param client Client that triggered this filter.
* @return True if pattern was recognized, false otherwise.
*
* @note To see if the client param is available, use FeatureType_Capability and FEATURECAP_MULTITARGETFILTER_CLIENTPARAM.
*/
typedef MultiTargetFilter = function bool (const char[] pattern, Handle clients, int client);
typeset MultiTargetFilter {
function bool (const char[] pattern, Handle clients);
function bool (const char[] pattern, ArrayList clients);
function bool (const char[] pattern, Handle clients, int client);
function bool (const char[] pattern, ArrayList clients, int client);
}
/**
* Adds a multi-target filter function for ProcessTargetString().