Ok, I'll add const to the keystate pointer, just to indicate that the hijacker shouldn't alter that, but honestly, if a person resorts to VMT hacks, I don't think it would stop him messing the contents of the array.A VMT Hijacker would need to be careful with hooking clbkConsumeDirectKey and clbkConsumeBufferedKey as these could potentially break vessel functionality. Is there any reason why the char *keystate argument couldn't be changed to const?
Code:virtual void on_clbkConsumeBufferedKey ( VESSEL2* vess, DWORD key, bool down, [B][COLOR=Red]const [/COLOR][/B]char *keystate ) {} virtual void on_ret_clbkConsumeBufferedKey ( VESSEL2* vess, int, DWORD key, bool down, [B][COLOR=Red]const [/COLOR][/B]char *keystate ) {}
Well, I don't think so. This would restrict developer to calling only VESSEL::xxx() const methods (mostly 'getxxx'), which IMO servers no purpose -- one can easily and legally obtain a non-const VESSEL* via oapiGetVesselInterface().And perhaps also generally we could change the VESSEL2* to const also?
