*Fixes a case where the IsHindrance query callback fails to take into account a special `CBaseEntityvalue calledIS_ANY_HINDRANCE_POSSIBLE`.**
This special value is passed by PathFollower to quickly determine if it should do additional yet more expensive checks for any entities that may impede path progress. If this special value is passed in, the query callback assumed it was a valid pointer and tries to convert it via EntityToBCompatRef, resulting in a crash. Now if this special value is passed in, an entity index of -1 is instead directly passed into the callback instead.
Fixes a case where using CBaseNPC_Locomotion.CallBaseFunction within IsEntityTraversable and ShouldCollideWith callbacks resulted in a crash.
The CallBaseFunction method was failing to take into account that when variable arguments are used, any cell parameter within the varargs are passed by-ref, not by value. The native now correctly resolves these references. To guard against further crashes and potentially other undefined behavior, errors will now be thrown if incorrect number of parameters are passed in. Checks for invalid entity index/references were added for IsEntityTraversable and ShouldCollideWith since valid entities are required for those functions.
Reformats include guards to use #endinput and to use relative paths instead.
This was mostly done to fix the VSCode SourcePawn extension not parsing over the include files. Auto-completion + snippets now work correctly. Also, formatting them this way brings them closer to how SM formats their include files.
Adds examples to using CBaseNPC_Locomotion callbacks to the scout test bot.
Changes:
IsHindrance
query callback fails to take into account a special `CBaseEntityvalue called
IS_ANY_HINDRANCE_POSSIBLE`.**This special value is passed by
PathFollower
to quickly determine if it should do additional yet more expensive checks for any entities that may impede path progress. If this special value is passed in, the query callback assumed it was a valid pointer and tries to convert it viaEntityToBCompatRef
, resulting in a crash. Now if this special value is passed in, an entity index of -1 is instead directly passed into the callback instead.CBaseNPC_Locomotion.CallBaseFunction
withinIsEntityTraversable
andShouldCollideWith
callbacks resulted in a crash.The
CallBaseFunction
method was failing to take into account that when variable arguments are used, any cell parameter within the varargs are passed by-ref, not by value. The native now correctly resolves these references. To guard against further crashes and potentially other undefined behavior, errors will now be thrown if incorrect number of parameters are passed in. Checks for invalid entity index/references were added forIsEntityTraversable
andShouldCollideWith
since valid entities are required for those functions.#endinput
and to use relative paths instead.This was mostly done to fix the VSCode SourcePawn extension not parsing over the include files. Auto-completion + snippets now work correctly. Also, formatting them this way brings them closer to how SM formats their include files.
CBaseNPC_Locomotion
callbacks to the scout test bot.