rehlds/ReAPI

SetHookChainArg with ATYPE_VECTOR error

Closed this issue · 2 comments

So I'm trying to modify RG_PlantBomb hook's arguments number 2 (vecStart) and number 3 (vecAngles) and I keep getting this error:
L 08/12/2022 - 17:45:54: [ReAPI] SetHookChainArg: invalid argument type provided, expected 'ATYPE_INTEGER'; got 'ATYPE_VECTOR'
Looking at the implementation here:
https://github.com/s1lentq/reapi/blob/97aea0f39712b337e7bf2ad4fea9a12ac753534e/reapi/src/natives/natives_hookchains.cpp#L271-L328

It looks like ATYPE_VECTOR isn't implemented. I don't know if this is the problem or it's still another issue.

Also I saw that PlantBomb's vector args are VectorRef and VectorRef's (Vector&) api type isn't implemented, but still don't know if that's the problem.
https://github.com/s1lentq/reapi/blob/dd1fdae53baa4c59e5ba61b0a21063d181669f2a/reapi/src/hook_callback.h#L44-L58

My ReAPI and ReGameDLL versions are the stable ones posted on release.

@aleeperezz16 no need to use SetHookChainArg for vector, just set the values directly like this

vecStart[0] += 100.0;
vecStart[1]  = 90.0;

Oh, forgot that FP_ARRAY parameters were always by reference. Sorry, thanks for the reminder.