Commit Graph
97 Commits
Author SHA1 Message Date
BotoX c2a86c77fd Add damageCustom argument to SDKHooks_TakeDamage native. 2024-06-09 17:45:24 +02:00
BotoX 2c86e8099a Add OnEntitySpawned to SDKHooks. 2024-06-09 17:41:10 +02:00
BenoistandKenzzer 7df2f8e045 Reconcile the concept of Edict & Networkable across the codebase (#1903)
* Reconcile the concept of Edict & Networkable across the codebase

* There's no need to check this, it's done elsewhere. Also could be null (segfault)

* This was never needed

* Pseudo review changes

Re-added removed null checks, and added new ones.

Changed the error messages in Get/SetProp natives to better reflect reality.

* Don't change the behaviour of GetEntityNetClass

* Overload IGameHelpers::FindServerClass

* Make error messages more accurate

* Fix a dev comment

* Rename FindServerClass

---------

Co-authored-by: Kenzzer <[email protected]>
2024-06-01 14:07:55 +00:00
Kaela e3734803f0 sdkhooks: retain vtable hook until level end (#2094)
* Band-aid for Bulk SDKHooks performance impact on linux

Platform specific changes.

* Oops forgot about header

* Simplified/improved LevelShutdown code
2024-05-18 12:30:20 +01:00
Alienmario 7d78c141e7 Fix SDKHooks IEntityListener (#2138) 2024-04-21 19:21:47 +00:00
Nicholas Hastings b42e5ac922 Convert AMBuild scripts to use hl2sdk-manifests (#2096)
* Add hl2sdk-manifests submodule

* Update AMBuild scripts to utilize hl2sdk-manifests

* Add build*/ to .gitignore
2023-12-18 23:15:44 +00:00
Rain 51bba0b894 Fix incorrect behaviour in SDKHooks_DropWeapon's "bypassHooks" parameter (#1877) 2022-12-27 19:31:02 +00:00
peace-maker 4320d7b17a Get sdktools and sdkhooks/dhooks to load on hl2sdk-mock (#1892)
* Build SDKTools for hl2sdk-mock

* Fix loading of extensions using advanced naming scheme for hl2sdk-mock

* Fix error on missing sv_visiblemaxplayers convar

* Build SDKHooks for hl2sdk-mock

* Fix x86_64 SourcePawn VM filename

* SDKHooks: Ignore missing IEntityListeners list in hl2sdk-mock
2022-12-22 18:39:12 +01:00
Nicholas Hastings b77e8c50ac Add support for Military Conflict: Vietnam (#1887) 2022-12-20 21:46:18 +00:00
peace-maker aab8c6ac9f Fix SDKHook_[Use|Spawn|GetMaxHealth] callback result value handling (#1872)
* Fix SDKHook_Use callback result handling

The returned result of the last callback in the list was used instead
of the highest value. This differs from the behavior of the other hooks.

* Fix SDKHook_Spawn callback result handling

The returned result of the last callback in the list was used instead
of the highest value. This differs from the behavior of the other hooks.

* Fix SDKHook_GetMaxHealth callback result handling

The returned result of the last callback in the list was used instead
of the highest value. This differs from the behavior of the other hooks.
The returned health is only changed if no other plugin wants to block the callback.
2022-12-04 12:12:42 +01:00
Spirrwell e34e9b9869 Split PVKII into its own engine branch (#1847)
* Initial PVKII branch support

* Change PVKII code to 23, DOTA uses 22 in MM

* Bunch more SE_PVKII preprocessor that was missed

* Add some missing SOURCE_ENGINE_PVKII cases

* Update PVKII FireOutput signature for Linux

* Update checkout-deps with 'pvkii'

* Fix FireOutput signature for PVKII, accidentally used one from newer build

* Change PVKII code to 10, and bump others by 1

* Only check against SE_SDK2013 here, like Metamod

* More SE_PVKII preprocessor cleanup
2022-10-24 19:27:32 +00:00
naydef 7d6eb2bd81 Fix crash in non-bypass-hooks DropWeapon implementation (#1672)
Fixes #1670
2021-12-15 10:41:55 +00:00
Benoist 329d587214 Fix ShouldCollide originalResult behaviour (#1657) 2021-11-30 09:24:56 +00:00
Nick Hastings 97383028e5 Add option to not bypass hooks with TakeDamage and DropWeapon natives. 2021-10-13 12:56:26 -04:00
Nick Hastings 4a6d263dad Remove obsolete core-legacy checks. 2021-10-13 12:56:26 -04:00
David Anderson 1b0c7bc1b8 Add support for hl2sdk-mock. 2021-09-22 12:36:44 -07:00
Asher Baker 78cb89938d Remove OnEntitySpawned forward (#1571)
`OnEntitySpawned` is 1.11 only, so this is fine given our API stability guarantees.

Unfortunately the forward name clashes with quite a few plugins using the same name for their SDKHook callback. Normally we'd just put up with this but there are difficult to solve binary compatibility issues where those plugins will get the callback double-called, and there is a separate issue where the forward isn't called for all entity spawns (unlike the SDKHook), so most plugins can't switch to the forward anyway.

Resolves #1558.

This reverts commit 7bab9cc344.
2021-08-23 21:36:20 +01:00
Asher Baker 70c9a6528a Remove entity lump manipulation from OnLevelInit
Newer Source engine versions now use a dynamically allocated buffer for
the map entity lump, and some maps have over 16MB of entity data - far
larger than our 2MB limit.

There is no sane way we can currently handle this, so just remove the
functionality from the forward until a more comprehensive API can be
designed.

Fixes #1470
2021-07-17 20:52:51 +01:00
Einyux 823b55c22a sdkhooks: Allow overriding SDKHook_Think (#1397)
* Allow to block Think()

* Update SDKHookCB comment
2021-07-10 12:42:17 -07:00
Asher Baker ea3f55f030 Remove OnEntitySpawned C++ listener (#1342)
This is causing crashes with existing extensions using entity listeners.

Currently no one is asking for a C++ hook here, if it is desired it
needs to be done with proper versioning of the listener interface, which
is going to be a little bit more complicated without an initial hard
break.

https://forums.alliedmods.net/showpost.php?p=2715337&postcount=789
https://discordapp.com/channels/335290997317697536/335290997317697536/748101258186850334

This is a partial revert of #1078.
2020-08-26 12:53:31 +01:00
David Anderson 785c6aa1cf Update to AMBuild 2.2.
This is a pretty big diff because SourceMod had lots of multi-arch
workarounds that can now go away. I've also changed 'x64' to 'x86_64' in
many places since this is how AMBuild normalizes it, and it's far too
late to pick the shorter string, so we might as well suck it up.

The --target-archs parameter has been replaced with --targets. It works
the same way.

The default behavior for SDK inclusion is now "present" instead of
"all" since this lowers the burden of storing many SDKs. Official builds
will still be made with --sdks=all.
2020-08-18 23:09:43 -07:00
PerfectLaugh 031f80f6e1 sdkhooks: assign velocities in CTakeDamageInfo(Hack) (#1322)
* Attempt to correct SDKHooks_TakeDamage

* Define function on both csgo and non-csgo

* Remove unneeded macros

* Fix velocity copy on CTakeDamageInfoHack init
2020-08-06 20:46:01 -07:00
BotoXandKyle Sanderson 7bab9cc344 sdkhooks: add OnEntitySpawned fwd. (#1078)
* Add OnEntitySpawned to SDKHooks.

* nitpicking

* Add CapabilityProvider SDKHook_OnEntitySpawned

* (unrelated) nits

* nit relocation

* unqualified relocation - my mistake.

Co-authored-by: Kyle Sanderson <[email protected]>
2020-08-06 20:01:07 -07:00
PerfectLaugh af76f757b5 Update SDKHooks_TakeDamage for CS:GO changes (#1319)
See alliedmodders/hl2sdk#77
2020-07-25 03:45:35 +01:00
David Anderson 3b386379dd Use more STL for vector insertion/removal. (#1284) 2020-06-13 15:57:02 -07:00
David Anderson 5d94f0bea8 Replace ke::Vector with std::vector. 2020-05-31 11:35:51 -07:00
Asher Baker 6465bd83a4 Update for latest Blade Symphony SDK 2020-03-11 22:36:25 +00:00
2251307218 9fb6430313 sdkhooks: correct velocity issues with dropweapon (#1159) 2020-02-26 16:11:17 -08:00
Kyle Sanderson cb8d92edeb SDKHooks: Reset global hookid when unhooking in SH. (#916)
Fixes https://github.com/alliedmodders/sourcemod/issues/912
2018-10-28 11:06:57 -07:00
Nick Hastings 9b8d28de56 Allow -1/null for attacker and inflictor for OTD (bug 6494). 2018-03-28 21:10:32 -04:00
Scott Ehlert ce1a4dcac0 64-bit support for CSGO on Linux and macOS (#705) 2017-12-20 01:56:23 -06:00
Nicholas Hastings 95afe72307 Separate out DOI build. (#718) 2017-11-03 15:45:16 -04:00
Michael Flaherty 4f54df65e9 Switch C header & Fix warnings (#702) 2017-10-15 10:32:01 +01:00
Scott Ehlert bbdecceb4b Switch to AMBuild 2.1 API. (#694) 2017-10-02 07:18:57 -05:00
Nicholas Hastings 29d1187434 Cache created entities by reference instead of index in SDKHooks (#634)
Fixes #663.
2017-07-06 13:33:34 -04:00
Nicholas Hastings ad3588d0aa Use newer MM:S api for Ep1/Original engine. (#548)
* Use newer MM:S api for Ep1/Original engine.

* Remove doubled FILENAME_1_6_EP1 define.
2017-01-11 21:25:00 -05:00
Nicholas Hastings 40f2512317 Remove support for Source 1 Dota 2. (#496) 2016-04-26 23:18:47 -04:00
Kyle Sanderson 2812f227b7 Change SDKHooks CanBeAutoBalanced to only MRES_SUPERCEDE if the return changes. 2015-12-29 12:44:03 -08:00
Nicholas Hastings 818e1e4e18 Add support for hooking CanBeAutobalanced to SDKHooks. 2015-11-26 10:35:00 -05:00
Fyren fec2fa3bf0 Update SP and use BlamePluginError in sdkhooks. 2015-11-18 01:24:31 +00:00
Nicholas Hastings a4d06e1077 Update CTakeDamageInfoHack in SDK Hooks for semi-recent game/SDK updates. 2015-11-11 13:12:04 -05:00
Nicholas Hastings 3291e3a38f Fix crash on Black Mesa when an entity is deleted and SDK Hooks is loaded. 2015-05-31 23:21:43 -04:00
Nicholas Hastings 64f9aedebc Add basic support for Black Mesa.
(Basically a copy of SDK 2013's support, but against BMS SDK).
2015-05-06 21:12:13 -04:00
Kyle Sanderson 7341bd184e Remove Project Files from older outdated build systems. 2015-04-01 19:54:34 -07:00
David Anderson eaea3c927d Update upstream AMTL as a submodule. 2015-03-08 00:24:03 -08:00
Nicholas Hastings e2aab2ab10 Don't allow plugins to block LevelInit (wtf). 2015-01-27 18:01:30 -08:00
Nicholas Hastings aa38226337 Fix SDKHooks causing crash on plugin load/unload or player connect/disconnect if missing gamedata. 2014-12-30 20:56:28 -05:00
Nicholas Hastings 77dc5ac7ed Fix build. 2014-10-14 17:47:44 -04:00
Nicholas Hastings 37c29775d4 Fix OnTakeDamage_Alive gamedata lookup in SDKHooks. 2014-10-14 17:36:55 -04:00
Nicholas Hastings be55587d70 Add OnTakeDamage_Alive hook support to SDKHooks (bug=6249). 2014-09-03 17:45:34 -04:00