Problem porting to OB
My plugin for HL2DM needs to be ported.
When I got all of the nit picky things changed, I'm getting this error on compiling: Code:
SH_DECL_MANUALHOOK0(GetBulletSpread_hook, 0, 0, 0, Vector const& ); |
Re: Problem porting to OB
Hello,
Hrm. On the first glance, this looks like a bug in SourceHook. It looks like reference returns are not supported with manual hooks at the moment. The reason is that a special class has to be utilized which encapuslates the return type when it's a reference and internally stores it as a pointer. Apparently this is done for normal hooks but not for manual hooks. I hope I just forgot to do it and there's not a bigger problem :) I will try to fix this ASAP. Greetings, PM. |
Re: Problem porting to OB
Ok, thanks!
This did work in EP1 games ( core-legacy ). Was it just maybe not brought over? |
Re: Problem porting to OB
1 Attachment(s)
Actually, the situation is likely to be more complicated than that.
My current understanding from reading the code is: Somewhen, the feature of declaring "extern manual hooks" was added (ie. declaring a manual hook in one compilation unit and using it in another). Until then, the macro RETURN_META_VALUE_MNEWPARAMS used to access something declared in SH_DECL_MANUALHOOK. This was not possible anymore, so a new function was added in SH_DECL_MANUALHOOK which did that part and RETURN_META_VALUE_MNEWPARAMS now only needs to call that function. The side effect is that that function is now always compiled and not only when someone does RETURN_META_VALUE_MNEWPARAMS. It turns out that what the function does ( = what RETURN_META_VALUE_MNEWPARAMS used to do there too ) is not compatible with reference return types. This means that this functionality was already broken, but nobody has noticed, because nobody has used RETURN_META_VALUE_MNEWPARAMS with a manual hook which has a reference return type. Or nobody has reported it or I haven't read the report :) And now with that 'exeternal manual hook declaration' feature the broken part is reported by the compiler as soon as you declare the hook. I have a potential fix on my hard disk (only involves changes in sourcehook.h) but have to add some more test cases before I send it to (unsigned long) 0xBA1L so I guess it'll be finished in the next few days. If you are actively using that hook and need to test it earlier please send me a PM. Greetings, PM Edit: Actually, why so complicated, here is the new sourcehook.h in case you wish to try it out. Beware: only tried on windows so far! |
All times are GMT -4. The time now is 04:09. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.