peace-maker / DHooks2

Dynamic detouring support for the DHooks 2 SourceMod extension
https://forums.alliedmods.net/showthread.php?p=2588686#post2588686
67 stars 11 forks source link

Suggestion [.INC file related] #4

Closed ClaudiuHKS closed 4 years ago

ClaudiuHKS commented 4 years ago

native bool DHookSetFromConf(Handle setup, Handle gameconf, SDKFuncConfSource source, const char[] name);

IIRC, SDKFuncConfSource needs sdktools.inc see https://sm.alliedmods.net/new-api/sdktools/SDKFuncConfSource

I suggest to edit the .INC file doing something about this. Either #include <sdktools> or #tryinclude <sdktools> + #if defined (_..._included) /* ... */ #endif.

Thanks for your great work though!

peace-maker commented 4 years ago

I didn't include something like this yet, since I thought it would obscure dependencies in plugins. Like only wanting an optional dependency on dhooks, but a strong dependency on sdktools. Thinking about it now, adding #include <sdktools> to the dhooks include file wouldn't hurt this at all.

You could still manually include sdktools before dhooks in your plugin and thus only include dhooks without REQUIRE_EXTENSIONS. DHooks itself requires bintools, sdktools and sdkhooks to be running to load up, so only wanting dhooks and not sdktools is not even possible.

I don't know what I was thinking when adding the DHookSetFromConf native, but it seemed like a good reason to not include sdktools back then. I guess we can just add it now.

peace-maker commented 4 years ago

#include <sdktools> is in the include file now.