sourcemod/plugins/include
Oliver John Hitchcock f9ad35badf
Stop EntRefToEntIndex returning garbage if a bad parameter is passed (#1323)
* Stop EntRefToEntIndex returning garbage if a bad parameter is passed

Seen multiple bad usage of this function that works only because whatever was passed in was returned as it wasnt an entity reference.
This code should have worked and would be expected to have returned something invalid but instead the the input was returned which allowed the code to work when really it is bad code.
See for one such case https://discordapp.com/channels/335290997317697536/335290997317697536/736518488314871868

* Update documentation of EntRefToEntIndex

Added the error text saying what shall be returned when a invalid parameter is passed.

* Validate entity index instead of just returning INVALID_EHANDLE_INDEX

Not sure if it needs this much validation but this just mirrors how IsValidEntity works, so the entity index returned should be valid else INVALID_EHANDLE_INDEX is returned.

* EntRefToEntIndex improve doc comments to better represent functionality

---------

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
2024-04-25 23:19:04 +00:00
..
admin.inc Add bitwise SetBitFlags for AdminId and GroupId (#1677) 2022-02-12 13:14:57 +01:00
adminmenu.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
adt_array.inc Fix typo in ArrayList.Clone docs (#2098) 2023-12-22 20:35:26 +01:00
adt_stack.inc Add more functions to ArrayStack (#2019) 2023-09-27 15:43:04 +02:00
adt_trie.inc Correct documentation in adt_trie.inc (#1465) 2021-04-04 15:11:30 -07:00
adt.inc added amb1538 - adt_stack 2008-04-13 06:06:27 +00:00
banning.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
basecomm.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
bitbuffer.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
clientprefs.inc Increase Cookie.GetInt/SetInt buffer size (#1995) 2023-04-22 01:19:36 -07:00
clients.inc [1.12] update maxplayers define for 07-25-23 tf2 update (#2026) 2023-07-26 20:13:31 +00:00
commandfilters.inc core: Add client id to MultiTargetFilter forward (#1070) 2021-03-08 10:04:11 -08:00
commandline.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
console.inc Add CommandIterator.ConVarFlags property (#1869) 2022-12-04 12:24:56 +01:00
convars.inc Removed incorrect parameter RemoveChangeHook desc 2021-10-23 11:28:23 -05:00
core.inc Update SourcePawn. 2023-11-02 18:38:30 -10:00
cstrike.inc cstrike.csgo: Add native to retrieve loadout slot of weapon (#1241) 2023-03-29 21:27:45 -07:00
datapack.inc Add an array operations to CDataPack (#1219) 2020-05-08 15:23:48 -07:00
dbi.inc database: flip to recursive_mutex to allow nested locks (#1937) 2023-03-29 20:03:03 -07:00
dhooks.inc Fix typo in DHookRaw docs (#2020) 2023-07-21 09:58:14 +02:00
entity_prop_stocks.inc Fix SetEntityHealth to support 'any' entities (#1846) 2022-12-20 22:07:57 +00:00
entity.inc Implement raw entity handle accessors (#1830) 2022-12-29 03:57:47 +00:00
entitylump.inc Add functions for working with entity lumps (#1673) 2022-09-05 15:44:58 -07:00
events.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
files.inc Implement File.Size (#2131) 2024-04-13 18:14:52 +00:00
float.inc Update SourcePawn. 2023-11-03 17:46:48 -10:00
functions.inc Add void function prototypes to NativeCall and MenuHandler (#2081) 2023-12-18 23:57:58 +00:00
geoip.inc Update GeoIP2 extension to new GeoLite2 .mmdb database format (#1245) 2021-06-30 13:01:12 +02:00
halflife.inc Stop EntRefToEntIndex returning garbage if a bad parameter is passed (#1323) 2024-04-25 23:19:04 +00:00
handles.inc Update SourcePawn. 2023-11-02 18:38:30 -10:00
helpers.inc Add comment about common.phrases to FindTarget (#1155) 2020-01-14 15:00:27 -08:00
keyvalues.inc Make KeyValues.Rewind traversal-stack clearing optional (#1993) 2023-04-17 13:10:02 +01:00
lang.inc Add GetClientOriginalLanguage (#1810) 2022-07-28 18:10:51 -07:00
logging.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
mapchooser.inc Reduce code size for strict dependencies on mapchooser (#1528) 2021-07-22 14:37:43 +02:00
menus.inc Add void function prototypes to NativeCall and MenuHandler (#2081) 2023-12-18 23:57:58 +00:00
nextmap.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
profiler.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
protobuf.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
regex.inc regex: add/document missing offset param (#1175) 2020-02-26 15:52:04 -08:00
sdkhooks.inc Add note about automatic unhook (#1910) 2023-01-22 10:23:40 +01:00
sdktools_client.inc Documentation corrections and additions (#1498) 2021-06-24 15:45:01 +01:00
sdktools_engine.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
sdktools_entinput.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
sdktools_entoutput.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
sdktools_functions.inc SDKTools: Add explode parameter to ForcePlayerSuicide native (#1782) 2022-07-07 14:14:50 +02:00
sdktools_gamerules.inc Support reading legacy sendprop arrays (#1550) 2021-08-23 21:21:11 +01:00
sdktools_hooks.inc Add a OnPlayerRunCmdPre forward (#1760) 2022-04-25 14:00:53 -07:00
sdktools_sound.inc Fix sound flags enumeration (#2040) 2023-09-27 17:03:03 +02:00
sdktools_stocks.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
sdktools_stringtables.inc Documentation corrections and additions (#1498) 2021-06-24 15:45:01 +01:00
sdktools_tempents_stocks.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
sdktools_tempents.inc Add TE_WriteEnt and TE_ReadEnt natives to SDKTools. (#1905) 2023-01-14 14:48:05 +00:00
sdktools_trace.inc Expose custom sdktools trace types from hl2sdk (#1822) 2022-12-02 14:11:05 +01:00
sdktools_variant_t.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
sdktools_voice.inc Documentation corrections and additions (#1498) 2021-06-24 15:45:01 +01:00
sdktools.inc Update SDKCall documentation for string return type (#1961) 2023-04-02 23:46:53 +02:00
sorting.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
sourcemod.inc Add ParseTime (strptime) native (#1697) 2023-07-04 13:42:45 +02:00
string.inc Add more context to Format etc documentation (#2079) 2023-11-06 16:07:00 +00:00
testing.inc Run basic native tests using hl2sdk-mock in CI (#2015) 2023-07-12 22:58:28 +02:00
textparse.inc Add SMCParser.ParseString (#1817) 2022-12-02 16:55:08 +01:00
tf2_stocks.inc Fix compiling with tf2_stocks 2021-10-27 07:51:33 -04:00
tf2.inc TF2: Add TFCond_ImmuneToPushback condition (#2023) 2023-07-26 02:10:08 +00:00
timers.inc Allow void return type in timer callbacks (#1916) 2023-03-02 21:28:42 -08:00
topmenus.inc Documentation corrections and additions (#1498) 2021-06-24 15:45:01 +01:00
usermessages.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
vector.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
version.inc Bump version to 1.12 for manual builds (#1795) 2022-07-05 15:13:52 +02:00
version.tpl Mirrored buildbot/version template changes from branch. 2008-09-14 06:13:25 +00:00