The passflags are only supported by SourceHook for virtual hooks and are ignored for detours with DynamicDetours. This caused confusion, so throw an error when trying to set e.g. the DHookPass_ByRef flag on detour arguments.
We always created a new vector object instead of changing the passed in vector directly. This works for the function being called using our changed values - but the caller doesn't see the changed values if it's passing a vector by reference.
Only create a new vector if there isn't one being passed in and set the values directly in the passed in vector otherwise.
Adds an OnPlayerRunCmdPre forward in order for plugins to be able to hook OnPlayerRunCmd with the guarantee that none of the parameters have been modified by other plugins. As such, OnPlayerRunCmdPre's parameters cannot be modified and are read-only.
Plugins that wish to use OnPlayerRunCmdPre can maintain backwards compatibility with SourceMod 1.10 by falling back to OnPlayerRunCmd if the Pre variant was never fired.
* DHooks: Allow setting CBaseEntity* param to NULL #1751
The param had to be a valid entity and wasn't allowed to be set to NULL. Behave similar to SetReturn which maps INVALID_ENT_REFERENCE (or -1) to NULL.
* Update include documentation
* Update offsets for ZPS 3.2
Zombie Panic! Source Version 3.2 released and these are the updated offsets.
* Update offsets for 3.2
ZPS 3.2 has been release and these are the updated offsets / signatures.
* ZPS: Add missing offsets.
Adds support for OnTakeDamage_Alive, GetMaxHealth, Blocked, Reload and GroundEntChanged.
I wasn't aware these were missing entirely or I would have pushed them with the previous PR.
* ZPS Add missing offsets.
Adds support for GivePlayerAmmo.
Wasn't aware these were missing the first place.
* Fix ForcePlayerSuicide not properly working in ZPS
ZPS requires the second bool parameter to be true otherwise it won't do anything for players in the lobby or delayed for players on either team 2 or team 3.
* Fixed breaking code for other mods.
Added bForce which is set to true for zps.
* Update offsets for ZPS 3.2.4
Updates the offset
* Update offsets for ZPS 3.2
Zombie Panic! Source Version 3.2 released and these are the updated offsets.
* Update offsets for 3.2
ZPS 3.2 has been release and these are the updated offsets / signatures.
* ZPS: Add missing offsets.
Adds support for OnTakeDamage_Alive, GetMaxHealth, Blocked, Reload and GroundEntChanged.
I wasn't aware these were missing entirely or I would have pushed them with the previous PR.
* ZPS Add missing offsets.
Adds support for GivePlayerAmmo.
Wasn't aware these were missing the first place.
* Fix ForcePlayerSuicide not properly working in ZPS
ZPS requires the second bool parameter to be true otherwise it won't do anything for players in the lobby or delayed for players on either team 2 or team 3.
* Fixed breaking code for other mods.
Added bForce which is set to true for zps.
* Update offsets for ZPS 3.2
Zombie Panic! Source Version 3.2 released and these are the updated offsets.
* Update offsets for 3.2
ZPS 3.2 has been release and these are the updated offsets / signatures.
* Add LookupAttachment and GetAttachment
Offset and Signature for Zombie Panic! Source.
* Fix Gamerules not being available
This fixes the issue that would throw an error when trying to use SDKCall with type SDKCall_GameRules.
* Add SetOwnerEntity offset
Add SetOwnerEntity offset
The DB API requires FetchRow to be called before accessing any values
from a row, but the SQLite driver did not enforce that requirement and
alowed accessing the first row immediately. A plugin developer hit this
when developing against SQLite locally but using MySQL in production,
where the API misuse threw an error as expected.
Resolves#1691
FindSendPropOffs is deprecated and FindSendPropInfo behaves correctly
here, but there are still a lot of old plugins using FindSendPropOffs.
One of the SendPropArray props broken by the changes here is
m_hViewModel which there are known plugins in the wild accessing.
* Update dhooks.inc documentation for consistency
- Modifies whitespace (change tabs to spaces for non initial indents, fix alignments, create consistency with rest of SM docs)
- Change `/*` to `/**` for consistency and to indicate comment doc
- Removes incorrect `@noreturn` doc
* Split long comments across multiple lines
* Remove `@noreturn` in IGameConfigs.h
* Remove `@noreturn` from IGameHelpers.h
* Remove `@noreturn` from asm.c
* Add `@noreturn` to ThrowError
* Add `@noreturn` and `@error` to ThrowNativeError
Using the virtual `CBaseAnimating::GetAttachment(int, matrix3x4_t &)` was a deliberate choice because virtual offsets are generally easier to maintain than signatures. The `matrix3x4_t` is converted to world position and world angles internally.
Some of the other overloads are also inlined on a few games, making this the best choice.
Since this call can only be used on classes inheriting `CBaseAnimating`, we check if the `DT_BaseAnimating` SendTable exists on the entity, throwing a native error if it doesn't.
This safeguard could be greatly improved with a call to `CBaseEntity::GetBaseAnimating`, but would require more gamedata (maybe something to consider for the future?)