Code:
if (Hack && InGame())
memcpy(address, PatchBytes, Size);
else
memcpy(address, OriginalBytes , Size);
Or, why not try some ternary operators
Code:
(Hack && InGame())?memcpy(address, PatchBytes, Size):memcpy(address, OriginalBytes , Size);
The code written by the OP of this thread made me want to cry it was so inefficient. Function calls are pretty expensive, and he made TONS of unnecessary ones. At the beginning of each frame, cache the result of the InGame call to a variable, and then use that.
Code:
//gobals
bool statusCache;
//top of present
statusCache = InGame();
//then for accessing it
if (Hack && statusCache)
memcpy(address, PatchBytes, Size);
else
memcpy(address, OriginalBytes , Size);
This would save lots of resource usage over time.