sourcemod icon indicating copy to clipboard operation
sourcemod copied to clipboard

Add SDKHook_AcceptInput hook type

Open Alexeyt89 opened this issue 4 years ago • 2 comments

AcceptInput function is called when a light entity is swithced on/off, a door is opened/closed and in hundreds of other situations. AcceptInput offset is available in gamedata and is regulary updated, It would be nice to have the possibility to hook entity inputs with SDKHooks. variant_t can be translated as 3 variables in sp: char[], int, float. Another way is to add a GetVariant function for each SetVariant: https://sm.alliedmods.net/new-api/sdktools_entinput

Alexeyt89 avatar Dec 12 '21 21:12 Alexeyt89

Any reason not to use dhooks instead ?

Kenzzer avatar Dec 14 '21 13:12 Kenzzer

AcceptInput is like entity outputs - one of the fundamental functions for interracting with entities and as there is a maintaned offset in gamedata, why don't have this hook part of SDKHooks? That would be widely used, I believe and it would not require Dhooks extension, which is not as handy in use as SDKHooks. If look at the situation from the other side, SDKHooks can be removed from sourcemod as technically any function can be hooked with using DHooks and SDKHooks is excessive.

Alexeyt89 avatar Jan 03 '22 13:01 Alexeyt89