* 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>