Go to file
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
.github Bump actions/cache from 3 to 4 (#2103) 2024-02-12 14:01:26 +01:00
bridge/include Implement File.Size (#2131) 2024-04-13 18:14:52 +00:00
configs fix: sorted alphabetically, remove duplicate 'ko' (#2121) 2024-03-05 01:20:40 +00:00
core Stop EntRefToEntIndex returning garbage if a bad parameter is passed (#1323) 2024-04-25 23:19:04 +00:00
editor Updated sourcepawn.php to latest array syntax 2023-11-30 21:58:49 -08:00
extensions Fix SDKHooks IEntityListener (#2138) 2024-04-21 19:21:47 +00:00
gamedata x32 Windows Gamedata Fixes for 4/18/2024 TF2 Update (#2137) 2024-04-19 18:00:30 -07:00
hl2sdk-manifests@22f699a941 update manifests (#2106) 2024-01-26 21:18:14 +00:00
licenses Fix quote mismatch (#1092) 2019-09-30 22:43:18 -07:00
loader Add support for Military Conflict: Vietnam (#1887) 2022-12-20 21:46:18 +00:00
plugins Stop EntRefToEntIndex returning garbage if a bad parameter is passed (#1323) 2024-04-25 23:19:04 +00:00
public Deprecate CreateInterface (#2001) 2023-11-11 16:59:22 +00:00
sourcepawn@d59a51b574 Fix macOS scripting SDK build. 2023-11-04 23:01:44 -07:00
tools Update checkout-deps files to install hl2sdk-mock (#2102) 2024-01-22 15:30:15 +00:00
translations Update Hebrew translation phrases (#2050) 2023-11-24 16:56:14 +01:00
versionlib Update to AMBuild 2.2. 2020-08-18 23:09:43 -07:00
.arcconfig Add a .arcconfig file so that arc works 2013-10-15 22:57:59 +01:00
.gitattributes NPOTB: Correct GitHub's Linguist inaccuracies (#1096) 2019-10-07 19:14:09 +01:00
.gitignore Convert AMBuild scripts to use hl2sdk-manifests (#2096) 2023-12-18 23:15:44 +00:00
.gitmodules Convert AMBuild scripts to use hl2sdk-manifests (#2096) 2023-12-18 23:15:44 +00:00
.travis.yml Prefer python3 over python(2) in checkout-deps (#1424) 2021-03-07 13:50:15 +01:00
AMBuildScript Convert AMBuild scripts to use hl2sdk-manifests (#2096) 2023-12-18 23:15:44 +00:00
appveyor.yml Add support for hl2sdk-mock. 2021-09-22 12:36:44 -07:00
changelog.txt Triggering a build. 2011-04-13 19:05:41 -05:00
configure.py Add support for ASAN. 2021-11-11 23:41:42 -08:00
product.version Bump master to 1.12. 2022-07-02 17:02:08 -07:00
pushbuild.txt Revert "Trigger build for hl2sdk-tf2 changes" 2024-04-22 21:31:14 -04:00
README.md Bring languages into the tree (#1625) 2023-03-29 16:23:05 +02:00

SourceMod

General

Development

Contact

  • Connect with us on GameSurge IRC in #sourcemod
  • Alternatively feel free to join our Discord server

License

SourceMod is licensed under the GNU General Public License version 3. Special exceptions are outlined in the LICENSE.txt file inside of the licenses folder.